473,406 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

CSS tab menu with uniform borders

Hey.
I'm creating a horizontal boxed CSS menu for my site using lists. I wish to achieve a main menu bar something like this:
http://kurafire.net/log/

however when I add borders to my code it adds the borders of each li so I get double thickness borders. I only want 1px so its a problem. here is my code:

Expand|Select|Wrap|Line Numbers
  1. <style>
  2. #underlinemenu{
  3. margin: 0;
  4. padding: 0;
  5. display: inline;
  6. }
  7.  
  8. #underlinemenu ul{
  9. margin: 0;
  10. margin-bottom: 1em;
  11. padding-left: 0;
  12. float: left;
  13. font-weight: bold;
  14. width: 100%;
  15. border: 1px solid #DFDFDF;
  16. border-width: 1px 0;
  17.  
  18. }
  19.  
  20. * html #underlinemenu ul{ /*IE only rule. Delete extra margin-bottom*/
  21. margin-bottom: 0;
  22. }
  23.  
  24. #underlinemenu ul li{
  25. display: inline;
  26.  
  27. }
  28.  
  29.  
  30. #underlinemenu ul li a{
  31. float: left;
  32. color: gray;
  33. font-weight: bold;
  34. padding: 4px;
  35. text-decoration: none;
  36. background: white url('') top right repeat-y;
  37. border: 1px solid black;
  38. border-width: 0 1px;
  39. }
  40.  
  41. #underlinemenu ul li a:hover{
  42. color: black;
  43. background-color: #F3F3F3;
  44. border: 1px solid black;
  45. border-width: 0 1px;
  46. }
  47.  
  48.  
  49. </style>
  50. HTML:
  51. <div id="underlinemenu">
  52. <ul>
  53. <li><a href="" title="Home">Home</a></li>
  54. <li><a href="" title="link 2">Link 2</a></li>
  55. <li><a href="" title="link 3">Link 3</a></li>
  56. <li><a href="" title="Link 4">Link 4</a></li>
  57. </ul>
  58. </div>
  59.  
this gives me this:


is there a way to get uniform 1px borders throughout this menu? thanks
Aug 29 '06 #1
2 4604
figured it out on my own..just made the left margin -1px.
Aug 29 '06 #2
Banfa
9,065 Expert Mod 8TB
An alternitive (an personally I don't like negative numbers in CSS if it can be avoided) would be

border-width: 0 1px 0 0;
border-style: solid;
border-color: black;
Aug 29 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

26
by: Thomas Mlynarczyk | last post by:
Hi, Could some kind person using Mac or Linux (or others) please take a look at http://www.mlynarczyk-webdesign.de/tmp/menu/menu.html and tell me if the page renders as it should (screenshot...
2
by: Jacob | last post by:
I'm trying to create an MDI form where the MDI area dosn't have the traditional 3D borders. I thought at one point the code I had in the form constructor was working, but now I'm getting an MDI...
2
by: Peter Proost | last post by:
Hi, I've got the following ownerdraw menu: drag a mainmenu on a form and add some menuitems to it, set all the menuitems to ownerdraw = true and for every menuitem add this code (replace...
2
by: jason | last post by:
Does anybody know how I would get borders around each menuitem? Do I have incorportate into a table? Thanks. The below produces a border around the entire menu. <form id="form1" runat="server">...
3
by: Timmah1980 | last post by:
I'm sure this is a simple enough fix for someone out there, but I'm afraid it's beyond me! I'm putting together this simple menu for a client: http://www.timkeay.co.uk/mpc2/index.htm It...
2
by: Dustan | last post by:
I don't know if this is because of Tkinter (ie Tk) itself or the Windows default way of handling things, but when I create a very long menu (my test is shown below), the way it displays is rather...
38
by: JTL | last post by:
I have learnt java before and now begin to learn c++ what puzzle me is that seem that different SDKs(c++builder, vs.net, gcc..) has its own class library we know that in java there are only one...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.