PDA

View Full Version : Are these .css codes okay ?


morrisdan1
04-07-2003, 01:15 PM
Hi,

Just to make sure, are the following codes okay ?

div, li, p, td {font: 16px times new roman; }
td { font: bold 12px ms sans serif; }

This "shortcut" seem to work when viewing my web pages using the Internet Explorer and Netscape browser.

Does it also work for some of the other browsers ?

What I mean by "shortcut" is that I simply just typed "font: bold 12px ms sans serif; " rather than writing it all out using tags like "font-family", "font-size", etc...

Is that okay ? Especially with some of the main browsers ?

Sincerely,
--Dan
1Heluva.com Surf-For-Hits and Enhance Your Financial Future
http://www.1heluva.com/cgi-bin/join.cgi?refer=31827

Andilinks
04-07-2003, 04:01 PM
You might run them by the W3C validator.

http://jigsaw.w3.org/css-validator/

Tell me exactly where these appear on the site, I'll view them in my browsers.

Grendel
04-08-2003, 11:55 AM
Sure, it should work fine. In fact, I have never seen a CSS-capable browser where the "font:" shortcut didn't work. It even works in the much-maligned Netscape 4.

The only thing to watch out for is that you can't put the various CSS values in just any order: "bold" and "italic" have to come before the font size, which have to come before the font family. See the font: property specification (http://www.w3.org/TR/REC-CSS1#font) for more information.

morrisdan1
04-08-2003, 07:53 PM
Andilinks,

Thanks for the link to the validator. Sounds like something I could use. Which I've bookmarked it.

Sure. The sidebars on all of my pages uses the following code:

.sidebars td { font: bold 12px ms sans serif; height: 17 px; text-align: center; text-valign: middle; }

As you see the "font: bold 12px ms sans serif" should work on all pages. Using the following as an example:

http://www.dansbanners.com

morrisdan1
04-08-2003, 07:56 PM
Grendel,

As for your comments shown below:

"The only thing to watch out for is that you can't put the various CSS values in just any order: "bold" and "italic" have to come before the font size, which have to come before the font family. See the font: property specification for more information."

That's what I thought. Ok, thanks for your input and for the link.