Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Within 'header DIV' I am unable to set the div 'nav' ul list item to inline in the following code:
XML
<div id="nav">
<ul id="mainmenulist">
<li class="hori">Home</li><br />
<li class="hori">About Us</li><br />
<li class="hori">Projects<br />

 <ul>
                <li><a href="#">Completed</a></li>
                <li><a href="#">On going</a></li>
                <li><a href="#">About to start</a></li>
            <li><a href="#">Photo Gallery</a></li>
            </ul>
            </li><br />

<li class="hori">Contact Us</li><br />
<li class="hori">Mail us</li><br />
</ul> <%--mainmenulist--%>
</div> <%--nav--%>



CSS
#header {
     top:0px;
     margin:0px;
     padding:0px;
     background-color:Gray;
     color:white;
     height:50px;
     position :fixed;
     text-align:left;
     padding:5px;
     width:1013px;
}

#header h1
{
     margin-top:-2px;
     color:Yellow;
     font-size:xx-large;
}
#nav {
    position:fixed;
    margin-left:82px;
    background-color:#eeeeee;
    height:210px;
    width:640px;
    float:right;
    padding:10x;
    top:22px;


 }
#nav ul#mainmenulist li{

     font-size:medium;
     color:red;
     font-family:Verdana;
      font-weight:normal;
      left:auto;
      cursor:default;

 list-style-type:none;
    }
Posted

1 solution

S.Rajendran from Coimbatore wrote:

#nav ul#mainmenulist li

You can't mix element names and ID selectors like that. Remove the ul:
CSS
#nav #mainmenulist li


Try running your CSS through CSS Lint[^]. Or, if you're using Visual Studio, try the CssCop extension[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900