I`m trying to create a menu for a site and i want to align UL in the center. It works fine if i test it on the w3school try it your self thing but not on the MVC site.css file.
here is my _layout file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
</head>
<body>
<div id="header">
<h1>
My web site
</h1>
<div id="menu">
<ul id="navlist">
<li class="first">
<a href="/" id="current">Home</a>
</li>
<li>
<a href="/About">About Me</a>
</li>
</ul>
</div>
</div>
@RenderBody()
</body>
</html>
and my site.css file
body
{
font-size: .85em;
font-family: "Trebuchet MS", Verdana, Helvetica, Sans-Serif;
color: #232323;
background-color: #fff;
}
header,
footer,
nav,
section {
display: block;
}
/* Styles for basic forms
-----------------------------------------------------------*/
fieldset
{
border:1px solid #ddd;
padding:0 1.4em 1.4em 1.4em;
margin:0 0 1.5em 0;
}
legend
{
font-size:1.2em;
font-weight: bold;
}
textarea
{
min-height: 75px;
}
.editor-label
{
margin: 1em 0 0 0;
}
.editor-field
{
margin:0.5em 0 0 0;
}
/* Styles for validation helpers
-----------------------------------------------------------*/
.field-validation-error
{
color: #ff0000;
}
.field-validation-valid
{
display: none;
}
.input-validation-error
{
border: 1px solid #ff0000;
background-color: #ffeeee;
}
.validation-summary-errors
{
font-weight: bold;
color: #ff0000;
}
.validation-summary-valid
{
display: none;
}
#menu
{
margin-top:40px;
clear:both;
}
ul#navlist
{
border-bottom:1px #5C87B2 solid;
padding: 0 0 2px;
position: relative;
margin: 0;
text-align:center;
}
i`m new to MVC and Web dev as whole so any help will be appreciated
This post has been edited by raziel_: 13 January 2012 - 09:33 AM

New Topic/Question
Reply



MultiQuote







|