Forum Moderators: open
I am building a site that needs to be as compatible with as many browsers as possible. Thus I am using CSS to a limited extent (fonts and colours mainly), and a table for basic page layout.
The issue I have is at the bottom of each page I put a line of text links for the site for use if the graphic links do not show/or the user choose not to view them. This is a simple line of links in one table cell, with non-breaking spaces inbetween and the standard square brackets around each one. They are left aligned and the colour and size controlled by the CSS. In all browsers they display as desired, except Netscape 4.05 (the Netscape 4 that I test on) which breaks the links at the exact point of the </a> tag in the text.
I have tried removing the class attributes from the <a> tags, but that simply removes the font/colour, but the text is still broken on different lines.
Does anyone know of a particular bug where Netscape breaks the line after an <a> tag - or of any other reason why this may be?
Thanks
Wishful
What may be happening here is that text (even if defined to the pixel in your code) takes up different amounts of room in different browsers. Unless you've instructed the browser otherwise, the line may wrap after the anchor tag closes, if the browser calculates that not wrapping will force the table cell to be wider.
There is this possibility in CSS:
<td style="white-space: no-wrap;">your stuff</td>
...but Netscape 4 does not support the white-space property. If you want NN4 support, you could also try this old-style attribute approach. It is deprecated, but still valid and widely supported:
<td nowrap>your stuff</td>
However, either of these approaches may also force the table to go wider than you've dictated - depending on the browser's native fonts - and give you some side scrolling.
You might also want to be sure that padding and margins (cellspacing and cellpadding) are explicitly declare - or else different browsers may be adding their own unique default values.
Thank you for that. I hadn't realised that a reply had been posted (thought I'd set preferences to email when a response came in), so apologies for my late response to you.
I've noted your advice for future reference, but have fixed the problem in the meantime. Something simple like left alignment on one of the main styles in my CSS. Doh!
Thanks again
Wishful