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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS / Netscape problem

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I've got a problem with CSS and the Netscape Navigator. This is a class from my .css-file:

.bord { border:1px solid #2a2a2a }

When I use it like this:

<table>
<tr>
<td class=&quot;bord&quot;>
test
</td>
</tr>
</table>

then ist works with IE (there's a thin border around the table-cell), but it does not work with Netscape. Please tell me if I made a mistake, or if there are any alternatives to get the desired effect! And sorry for my bad englisch. ;-)

Bye, Malle
 
Hi Malle,

I've had all sorts of problems in the past with CSS borders and Netscape (not sure how there support for these is going since 6 was released).

One way to acheive a similar effect (I think its too kludgy myself, but I've seen it on a number of fairly large sites now) is to use tables-within-tables (something I've always been loathe to do). Set the background color on the slightly larger, outer, table to whatever you want the border color to be, and then set the background color of the inner table to the color you want the cell to be.

Have a play with that and see if it meets your needs.
 
A similar fix to Arion23's, using only a single table, is to set that table's cellspacing to 1, set the background color of the table to [dark blue for example], and set the background of each individual cell in the table to [background color of the page, perhaps]. The net effect is a narrow border around each cell. Unfortunately, this is only useful if you want to put the border around every cell in your table ... if you were hoping to border a single cell, you'd have to stick to CSS.
 
Just my 2 cents...

I was forced to become a CSS master almost overnight over a year ago.. Here's what I recommend to everyone using CSS and worried about cross-browser compatibility: Use TopStyle by Bradbury.

Yes, it's a gui and yes it can make you extremely lazy when it comes to coding, but that's only if you aren't interested in learning. Sorry, don't mean to preach. The point is, it has the ability to tell you, as you create your CSS, which browsers your classes will work with.

It's a great educational tool for people who use CSS but don't know what standards will work with which browsers, etc.

And, might even help you find an alternative class to the above problem.

I have found that using external CSS' files with Netscape is touch-n-go on occasion. I have actually 'fixed' problems like that by defining on the page (which gets messy) or inline (even worse, but it worked), which almost defeated the purpose of the CSS to begin.

Try it out, hope it helps! &quot;Absorb what is useful, discard what is not. Add what is uniquely your own.&quot; - Bruce Lee - The Tao of Jeet Kune Do
 
I had a similar problem with borders, I ended up using graphics. I wanted a one pixel width border and couldn't seem to find a dependable way using nested tables or any other method in netscape 4.7.

Also Mozilla 9.1 didn't seem much better, I could get the border I wanted using css but the tables didn't layout the same.

Is this cross-browser situation ever going to get any better?
 
Yes, if Microsoft ends up owning them all. ;)

You realize that when you add borders with a CSS you have to account for the offset, right? In other words: before the CSS you had a table that HAS to be no more or less than 100 pixels in width. If you add a CSS with a 1px border, you will go over 2 pixels in your table with (the border is added to the overall size). So you would size your table down to 98px.

Just a thought. Not sure if that relates to what you mentioned above(newimprovedmedia). &quot;It's easier to ask forgiveness than it is to get permission.&quot; - Rear Admiral Dr. Grace Hopper
 
Uh -- the size of the table would not go down to 98 pixels in any browser but IE 4/5 -- Its supposed to add to the total width-- can give you the link to the css spec if you would like. ===
Supports Mozilla and Web Standards
Knows HTML/XHTML, CSS1, JavaScript, PHP, C++, DOM1
===
 
Also on a side note -- IE5's css support is not all that good when you get into more complicated things. It does not support a correct box model nor does it support css2 selectors.

For instance,
input[type=&quot;password&quot;] {
....style here
}

Doesn't work in IE4/5/6. =( ===
Supports Mozilla and Web Standards
Knows HTML/XHTML, CSS1, JavaScript, PHP, C++, DOM1
===
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top