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

  • Home
  • SEARCH
  • 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 120531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:49:34+00:00 2026-05-11T03:49:34+00:00

You will notice the :hover CSS for the links in the main nav area

  • 0

You will notice the :hover CSS for the links in the main nav area (grey bar under logo) for the site testing.ksischool.com works fine in Firefox, but IE7 chops off the bottom few padding pixels. Why?

  • 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. 2026-05-11T03:49:35+00:00Added an answer on May 11, 2026 at 3:49 am

    I assume you’re talking about the top navigation; you’re padding an inline element (the <a> tag). When placing padding on an inline element, horizontal padding will push against other elements, but vertical padding will just increase the size of the element without affecting the layout around it. Likely Firefox is rendering the boxes above the elements below them in the source, but for whatever reason IE is rendering them beneath, which is why you’re seeing parts of the box disappear.

    To fix the problem, float all of the links left (which essentially turns them into block elements). You’ll need to adjust your markup elsewhere to make it work (likely have some clearing problems if you just float straightaway), but that should fix that specific IE issue.


    Edited for more detail:

    As mentioned above, vertical padding on an inline element doesn’t behave the way you would expect (it increases the element’s height, but because the padding doesn’t interact with other page elements the inline element often overlaps things in odd ways). So to fix this, you somehow need to make the padded element (the <a> tag) have display: block. To keep everything on the same line, floating left is your best bet. Here’s the markup and styling that I would use:

    <style type='text/css'> .mainnav {     font-size: 1em;     color: #999;     list-style-type: none;     /* zoom triggers hasLayout on IE, ignored by others     Necessary for the clearfix */     zoom: 1; }  .mainnav:after {     /* This lets the .mainnav auto-clear its floated contents */     content: '.';     display: block;     height: 0;     clear: both;     visibility: hidden; }  .mainnav li {     float: left;     margin: 0 2px;     /* Place background (disc image) here w/ appropriate padding */ }  .mainnav li.last {     background: none; }  .mainnav a:link, .mainnav a:visited {     display: block;     color: #fff;     text-decoration: none;     padding: 1px 1px 2px;     border: solid 1px transparent; }  .mainnav a:hover {     color: #fff;     background: #999;     text-decoration: none;     padding: 1px 1px 2px;     border: solid 1px #ccc; }  .mainnav a.selected, .mainnav a.selected:hover {     color: #B59B24;     background: transparent;     text-decoration: none; } </style>  <ul class='mainnav'>     <li><a href='/' class='selected'>Home</a></li>     <li><a href='/About' >About</a></li>     <li><a href='/Admissions' >Admissions</a></li>     <li><a href='/Curriculum' >Curriculum</a></li>     <li><a href='/Home/VacancyList' >Careers</a></li>     <li class='last'><a href='/Contact' >Contact</a></li> </ul> 

    Some things to note: I’m using a standard clearfix (Google this if you don’t know what I’m talking about) to make sure the UL clears its floated contents. This will allow the parent nav elements to grow in size appropriately if the user sizes up their font.

    Also, I removed the spacer &middot; and recommend using a background image and .last class in the CSS. This is purely personal preference. (In an ideal world, you’d use the :after pseudo-class to inject the &middot;, but thanks to IE 6 not supporting it you can’t do that and support all browsers.) My reason for recommending a background image rather than just leaving it in the markup is that it leads to cleaner markup and is far easier to change down the road (if your client decided they wanted a pipe rather than a dot, say).

    The logic behind this markup/styling is that you need padding on the <a> for the border/background color to work which means it has to have display: block. Adding that would stick every link on a different line, though, so you need to float either it or its parent. Since it’s part of a list, it’s easier to float the li parent and use a clearfix to make sure the ul still has some presence on the page.

    Obviously if you use this code you’ll need to remove most of the #nav_banner element things lower down in the stylesheet, and you’ll likely need to debug cross-browser again. Even if you don’t, hopefully it will provide you with some ideas for easily constructing top navigation in the future.

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

Sidebar

Ask A Question

Stats

  • Questions 294k
  • Answers 294k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer NextResult() makes the reader advance to the next result set… May 13, 2026 at 6:44 pm
  • Editorial Team
    Editorial Team added an answer This is how the SVN book recommends you do it.… May 13, 2026 at 6:44 pm
  • Editorial Team
    Editorial Team added an answer To create such a hotkey, do this: ATOM hotkey =… May 13, 2026 at 6:44 pm

Related Questions

I have created a simple JQuery script with hovering effect on some links. The
Here is my site: http://wake9.com/blogs/norcal-merced-wakesurfing-competition-2009/ . Notice the menu item Photos and Results. Hover
The problem may appear in other browsers too, I haven't checked yet. Sorry but
After certain R#-recommended edits R# colors the background of blocks of code in a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.