Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bordercolorlight alternative

Status
Not open for further replies.

djd4n

Programmer
Jan 30, 2005
3
0
0
GB
Hi
i'm using the bordercolorlight and bordercolordark attributes to draw a box outline in a table by setting them to the same colour. you can see this on:
It is on the menu buttons home, news etc. This obviously only works in IE and not in anything else. How can I get it to appear in Firefox etc the same as in IE, basically making it XHTML compatible?

thanks

dan.
 
Use CSS instead of the various [tt]bordercolor[/tt] attributes, something along these lines...

Change the table to look like this:
Code:
<table id="menu" cellspacing="3">
  <tr>
    <td><a href='/demo_home.php'>Home</a></td>
    <td><a href='/demo_news.php'>News</a></td>
    ... etc ...
  </tr>
</table>
Then the border colour, along with other stuff previously held in sundry attributes, <div>, <font> and <b> tags can be put in your style sheet:
Code:
table#menu {
   width: 100%;
   border-collapse: seperate;
   border-spacing: 3px;
}

table#menu td {
   padding: 0;
   width: 10%;
   border: 1px solid #CCCCCC;
   text-align: center;
   font-family: Arial, Helvetica, sans-serif;
   font-weight: bold;
}

table#menu a {
   color: #666666;
}

table#menu a:hover {
   color: #AAAAAA;
}
Unfortunately, IE doesn't understand [tt]border-spacing[/tt], so I've had to leave the [tt]cellspacing[/tt] attribute in the HTML for its benefit, otherwise all the presentation information is in the CSS and the HTML just holds the content - which is how things are supposed to be.

Incidentally, if you added
Code:
body {
   font-family: Arial, Helvetica, sans-serif;
}
You wouldn't have to wrap every bit of text on the page in a <font> tag.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top