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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:30:28+00:00 2026-05-23T12:30:28+00:00

here is my css code for a horizontal menu, it’s cross browser and it

  • 0

here is my css code for a horizontal menu, it’s cross browser and it works great, well it has 1 glitch. 🙂

The #menu which wraps everything has to have width of 100%, but when I put a border on it, the border adds to the width making it larger and screws up my layout.
What I do is use jquery to substract the 2 pixel border. Is there a way to do this with css?

here is the menu’s css:

#menu {
width: 100%;
margin: 0 0 1em 0;
padding: 0.5em 0 0 0;
border-right: solid 1px #555;
border-left: solid 1px #555;
border-bottom: solid 1px #555;
}
#menu ul {
margin: 0 0 0 0.5em;
padding: 0;
list-style-type: none;
}
#menu li {
margin: 0;
padding: 0;
float: left;
width: 20%;
line-height: 1.5em;
margin-right: 1em;
margin-bottom: 0.5em;
background: url(images/headline.jpg) top repeat-x;
border: solid 1px #555;
text-align: center;
}
#menu a {
display: block;
width: 100%;
font-size: 70%;
text-decoration: none;
}
#menu a:hover {
background: #000 none;
}

Some notes:
The menu has to be wrapped by a div that is used for styling background color, left margin/padding, etc. I’ve found no way to style the UL itself, because I can’t clear the float inside it. Thus the height of the OL always equals zero.

Ty very much!

  • 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-23T12:30:29+00:00Added an answer on May 23, 2026 at 12:30 pm

    Use outline instead of border. It creates “borders” in the same way, only it places them on the inside of the frame, rather than the outside as border does.

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

Sidebar

Related Questions

I've got a css-based horizontal drop down menu that works perfectly well, but I'm
It has to be simple, here's my CSS: .progressImage { position:relative; top:50%; } .progressPanel
I have a css horizontal menu with a menu / submenu display working on
basically i have a side by side horizontal menu as you can see here:
I have a CSS Horizontal Menu in a table cell. I have set the
I'm trying to build a horizontal drop down menu with CSS. But the submenu
I created a drop down nav menu purely in css and everything works correctly
I need some advanced CSS help here. I have a login button and a
Here is a snippet of CSS that I need explained: #section { width: 860px;
Here is the problem: we have lots of Javascripts and lots of CSS files,

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.