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

Using <style></style> in Netscape 4x through current 2

Status
Not open for further replies.

Sam6284

Programmer
Apr 24, 2002
16
FR
What does Netscape want/expect

An overly simplified illustration of what I'm doing:

<head>
<style>
.Text { font-family: sans-serif; font-size: 10px; }
</style>
</head>

I specify the style using the class attribute:

<table>
<tr>
<td class=&quot;Text&quot;>My Text</td>
</tr>
</table>

This technique renders as desired in IE, but not Netscape. Is there a technique that works in BOTH IE and Netscape?

If it's not apparent, I'm new to this.

Many thanks.
 
what version on netscape are you running, just on the off chance, try changing the class Name from Text to something else
 
Version tested was Netscape 6, but I'll need it to work under Netscape 4 as well as IE 4x through current.

I sent a watered down example. In practice, class names include &quot;SmTxt&quot;, &quot;LgTxt&quot;, &quot;BoldHeadings&quot; ... maybe a dozen altogether.

I'm new to HTML, but not coding in general. I avoid the use of reserved words as well as words that may be objects, classes, etc.
 
rather than apply the class to the td tag put a font tag inside it and apply the class to that...

<td><font class=Text>My Text</font></td>
 
This is how I do it:
1) Instead of doing this:
.Text {font-family: sans-serif; font-size: 10px;}
do this:
td, th {font-family: &quot;Tahoma&quot;, &quot;Verdana&quot;, &quot;sans-serif&quot;; font-size: 10px;}

2) And it gets called just by the <tr><td> tags... I have not failed; I merely found 100,000 different ways of not succeding...
 
I've not tried either yet, but both approaches look good to me. Thanks.

I can see the td, th { parameters } method being an excellent approach on a simple table. Thanks for the great tip. Unfortunately, I'm working on a complex online loan application.

The <font> method will work better in this particular instance. I've got a question on it, though, because I'm still learning.

My documentation states: &quot;Use of this element (<font>) is not encouraged, as it is not part of the HTML 4.01 strict specification.&quot;

I've gone way out of my way to avoid using the <font> tag because of that statement.

Could someone translate into plain English how I should interpret &quot;not encouraged&quot; in terms of W3C standards? Is it safe to assume it will be around for the forseeable future?

 
In simple terms: Forget about it...
LOL, i'm not sure why the W3C would say, and to me it makes no sense, if you want to use the <font> tags then do it...it will not cause any problems in the browsers and I assure you, the folks from W3C will not come knocking at your door for breaking a law...lol...
I use <font> when I need to do, but I realized that the <td><th> CSS style is easier to use...
Go here: (someone posted this link here at tek-tips in the HTML/CSS forum), its clean and nice tutorial...might wanna give them a star if it helps ya...[smile] I have not failed; I merely found 100,000 different ways of not succeding...
 
If you dont feel like you want to use the font tag not to worry, there are other tags such as SPAN and P tags that you could use but as GUJUm0deL says, this is one warning from the W3C that can be taken lighly
 
I finally had a chance to complete the testing. Both methods worked precisely as expected in the four browser versions I tested: Netscape 4.3 and 6.2, and IE 5x and 6x.

Thanks very much for your help. Maybe I'll have an opportunity to return the favor some day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top