SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: CSS styles and Font tags?
-
Apr 5, 2001, 14:55 #1
- Join Date
- Sep 2000
- Location
- Milwaukee, WI
- Posts
- 225
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If I am using CSS to define the appearances of fonts on my site, should I still include the font tags or not?
i.e. my style:
.small {
font-family: Arial, Helvetica;
font-size: 10pt;
color: #000000
}
then,
<span class="small">this is my style !!</span>
Should I include <font size=2 face=Arial> in there or not?
-
Apr 5, 2001, 18:47 #2
- Join Date
- Mar 2001
- Location
- cambridge, MA
- Posts
- 122
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Using the stylesheet allows you to have the specific font style that you want without including the font tags.
If you are using different font styles etc - just set the various classes defining each style and then specify that class with whatever area you want.
I hope this makes sense
-
Apr 5, 2001, 19:03 #3
- Join Date
- Sep 2000
- Location
- Milwaukee, WI
- Posts
- 225
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I meant should I include the font tags in there to insure those w/out CSS can still see the font I intend to display the page with? Or is that not necessary?
-
Apr 6, 2001, 05:34 #4
- Join Date
- Mar 2001
- Location
- cambridge, MA
- Posts
- 122
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Oh, sorry - my misunderstanding.
I think that is a personal choice really. Depends on the site too I would presume. If it definitely needs the font specifications you've given in the CSS, then add in the font tags.
Personally, I dislike using Times on my sites, so I make sure I have it all set to verdana or arial - in the CSS and with font tags.
-
Apr 6, 2001, 07:01 #5
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
HC...
using the FONT tag would depend on whether or not you are using strange font styles.
For example, this:
body, table, tr, td, div {font-family: verdana; font-size: 10pt; }
will style EVERY instance of text on a page in 10pt verdana. That method will work perfectly in IE AND NS. If you want to colorize the text then do this:
.special { color: #cc0000; }
and call it like this:
<span class="special">This text is red</span>
That method ALSO works in IE AND NS.
Just keep in mind that Netscape's main troubles with stylesheets is it inability to correctly inherit properties from the parent element. For example:
p { font-family: times; color: green; font-size: 15pt; }
i {font-family: verdana; color: blue;}
<p>
This is text in a paragraph. It is merely filler. This is text in a paragraph. It is merely filler. This is text in a paragraph. It is merely filler. <i>This text should be italicized, verdana and blue.</i> This is text in a paragraph. It is merely filler. This is text in a paragraph. It is merely filler.
</p>
Now, when tags are nested like this, NS has problems inheriting the style of the parent. Using this example, the italicized text should be 15pt type. But in situations like this NS will not inherit the size of the parent element (the <P> tag).
(this might work in NS. I am just using it as an example)
Do you see? Most of your font declarations will work just fine in Netscape as long as you take a little time to plan.
Besides, the whole point to stylesheets is to get rid of bloated redeundant code. Using the FONT tag defets that purpose.Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
-
Apr 6, 2001, 07:31 #6
- Join Date
- Sep 2000
- Location
- Milwaukee, WI
- Posts
- 225
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks Lor and creole.
Bookmarks