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 6599473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:29:46+00:00 2026-05-25T18:29:46+00:00

I have the following html for a simple navigation: <header> <div class=login> <ul> <li><a

  • 0

I have the following html for a simple navigation:

<header>
    <div class="login">
        <ul>
            <li><a href="#">Link</a></li>
            <li><a href="#">Link</a></li>
        </ul>
    </div>
</header>

I have the following css:

header {
    height: 145px;
    border: 1px solid #f00;
}

.login {
    float: right;
}

.login ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.login li {
    display: inline;
}

.login li a {
    color: #fff;
    background-color: #666;
    padding: 5px 10px;
}

I am using HTML5 boilerplate so my header is displayed as a block element. When I view the page in a modern browser the result looks like:

modern

Why is the anchor padding extending outside of the red border/header element? What is causing this behavior?

Furthermore, when I view the same page in IE compatibility view, it now looks like:

compatibility

Here it seems like the padding is not applied at all or cut off by the containing div. I tried setting a height for the div but the result was still the same. What is causing this behavior?

Thanks

  • 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-05-25T18:29:46+00:00Added an answer on May 25, 2026 at 6:29 pm

    Try putting a display:block on .login li a and put a float:left on the .login li

    Also you can shorten your code and take out the unnecessary div and just put the class on the ul.

    HTML:

    <header>
        <ul class="login">
            <li><a href="#">Link</a></li>
            <li><a href="#">Link</a></li>
        </ul>
    </header>
    

    CSS:

    header {
        height: 145px;
        border: 1px solid #f00;
    }
    
    .login {
        list-style: none;
        margin: 0;
        padding: 0;
        float:right;
    }
    
    .login li {
        float:left;
    }
    
    .login li a {
        color: #fff;
        background-color: #666;
        padding: 5px 10px;
        display:block;
    }
    

    http://jsfiddle.net/KPzUv/

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

Sidebar

Related Questions

I have a simple nav made up of the following HTML; <div class=inner> <div
I have the following html <div id=menu> <ul class=horizMenu> <li id=active><a href=# id=current>About</a></li> <li><a
I have the following simple code : HTML: <div> <img src='http://i51.tinypic.com/4kz4g5.jpg' /> </div> CSS:
Simple question. I have the following HTML: <a rel=nofollow id=claim-job-link data-method=post class=button green claim-job
I have a simple question. I have the following html code <a href=# class=purchase>
I have defined a fieldset in HTML, and applied the following (simple) CSS rules
I have the following HTML: <div class=wrapper> <div class=label> foor bar baz </div> <img
I have several instances of the following HTML on a page: <div class=input radio
I have the following navigation html/code now duplicated across several Views: <ul class=topNav> <li
I have the following HTML snippet: <span class=target>Change me <a class=changeme href=#>now</a></span> I'd like

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.