Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8138813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:37:17+00:00 2026-06-06T11:37:17+00:00

Html: <body> <div> <header> HTML5 </header> <nav> <ul> <li><a href=>Home</a></li> <li><a href=>Logout</a></li> <li><a href=>Login</a></li>

  • 0

Html:

<body>
        <div>
            <header>
            HTML5
            </header>           
            <nav>
             <ul>
                    <li><a href="">Home</a></li>
                    <li><a href="">Logout</a></li>
                    <li><a href="">Login</a></li>

             </ul>

            </nav>
            <p id="navclear" />

css:

/*page*/
body{
    margin:0 auto;
    width: 800px;
    height:auto;
    border: 1px solid black;
}



/*navigation*/
nav{
    border: 1px solid black;
    background-color: #E3E3E3;
    height:auto;
}
nav ul{
    list-style:none;
    padding:0;
    !margin-top:0;


}


nav li a{
    float:left;
    text-decoration:none;
    display: block;
    padding-right:5px;
    width:75px;
    background-color: #E3E3E3;
    color:#66777F;
    !line-height: .5em;
    font-weight: bold;
    font-family:Cantarell, Arial, Helvetica, sans-serif;
}

nav li a:hover{
    color: #FE4C06;
}

#navclear{
    clear:both;
}

I am new to html5. Here i am facing problem with height property.I want to make my my nav height auto i tried the same with above syntax but the ul part overflowed from nav.Means height:auto; not working . i cant fix the same by nav ul {margin-top:0;}. Here my question is how to make nav height auto?

http://jsbin.com/alukej/edit#javascript,html,live

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T11:37:18+00:00Added an answer on June 6, 2026 at 11:37 am

    EDIT

    As thirtydot commented, you had the <p class="clear" /> in the wrong spot. Here’s revised code below:

    <nav>
      <ul>
        <li><a href="">Home</a></li>
        <li><a href="">Logout</a></li>
        <li><a href="">Login</a></li> 
      </ul>
      <div class="clear"></div>
    </nav>
    

    I deleted all of your unnecessary code (you still had a lot of “!”)

    • jsBin Edit 1

    Another option is to use nav li{ display: inline; } instead of nav li{ float:right; } Code below:

    • jsBin Edit 2

    ORIGINAL

    Just to expand on thirtydot and Nathanael’s comments.

    !higher:35px is the wrong syntactical usage of the exclamation point in CSS. See here for an explanation on how to use it correctly:

    • How do you read !important in CSS?

    With that said, it doesn’t appear that you need !important in your CSS code.

    Furthermore, you don’t need your last line either, height:auto; because that is already the default behavior of the element’s height property. So, as far as any of us can tell right now, your final code simply needs to be:

    • jsFiddle.net Demo

    HTML

    <nav>
      <ul>
        <li><a href="">Home</a></li>
        <li><a href="">Logout</a></li>
        <li><a href="">Login</a></li>
      </ul>
    </nav>
    

    ​CSS

    nav{
      border: 1px solid black;
      background-color: #E3E3E3;
    }​
    

    If you are trying do achieve something different, please edit your question and explain it more clearly. Sometimes pictures help with HTML questions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$(this).parent().parent() .children(this.attr(tagName).toLowerCase()) .css(background-color, yellow); xpath: /html/body/div/table/tr/td/b/a $(this).tagName is Anchor <a> the problem with this
I have the following HTML. <body> <div class=header></div> <div class=navdiv></div> <div class=mainarea> <p></p> <table>
how can i convert xpath like /html/body/div[3]/ul/li[1]/a[5] html > body > div[3] > ul
Given: Url - http://www.contoso.com/search.php?q= {param} returns: -html- --body- {...} ---div id='foo'- ----div id='page1'/- ----div
I made this Greasemonkey script: var maxpi = 250; var p1 = /html/body/div/div[2]/div/div[2]/table[2]/tbody/tr[1]/td[11]; var
http://subzerostudio.com/temp/verticalscroller/temp.html I want this scroll to effect the div#container instead of the body,html but
HTML <p href=products.php?ref=fijo&tipo=7001ad class=principal>Fijas</p> <div class=menu_body id=fijo> <a href=products.php?ref=fijo&tipo=7001ad>Normal (7001AD)</a> <a href=products.php?ref=fijo&tipo=7001md>Aislada (7001MD)</a> <a
I have a div directly under the body. My HTML looks like this: <body>
I have the following html divs : ... <body> <div id=barChart_div style=width: 600px; height:
I come across this: html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,d l,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,figure,footer,header,hgroup,menu,nav,section,menu,time,mark,audio,video{background:transparent;border:0;font-size:100%;list-style:none;margin:0;padding:0;outline:0;vertical-align:baseline;} The comment mention reset, I guess is used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.