FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


[beginner] CSS Font property :





yimaw
If you don't already know the html tag <font> has long been deprecated and one of the worst tags ever brought about in html.

What properties can i set for my font

font-family - family or generic name, eg:
style="font-family:verdana;"
style="font-family:serif;"

generic font families - serif, sans-serif, cursive, fantasy & monospace


font-weight - possible unit values:
xx-small
x-small
small
medium
large
x-large
xx-large
smaller
larger

pt
px
em
%


style="font-weight:12px;"


font-style - normal, italic, oblique

style="font-style:italic;"


font-weight - possible values:

normal
bold
bolder
lighter
100
200
300
400
500
600
700
800
900

style="font-weight:bold;"


font-variant - normal, small-caps

style="font-variant:normal;"

color name value or hexadecimal value most used

style="color:red;"
style="color:#ff9900;"

All declarations together

style="font-variant:normal;font-weight:bold; font-style:italic;font-weight:12px;font-family:verdana;color:blue;"

All declarations together - shorthand
The above version is a bit long now isn't it, don't worry we can cut it down, like so (use the same order always, you can leave values out though)

style=" font: italic normal bold 12px verdana;color:blue;"
style="font:bold 12px arial;color:yellow;"

note that the color property is always separate.


Where do i declare what font i'll be using?

You can use <span></span> tags, the replacement for <font>

Or you can set the style for any conatianer that the text will be in:

<p style="font:bold 12px arial;color:yellow;">text</p>

<div style="font:bold 12px arial;color:yellow;">text</div>

<td style="font:bold 12px arial;color:yellow;">text</td>

<body style="font:bold 12px arial;color:yellow;">


to learn how to apply different styles to different containers go to this tutorial
Related topics
[Beginner] css rollovers
[CSS] Height property in Internet Explorer
CSS- Text size
Beginner CSS/Javascript problem.
Typekit Custom & Unique Font for blogs and site using
I went the no image route!! What do you think?
Compatibility among IE, Firefox and Opera
Windows XP SP3 comming soon
<FIELDSET> ?
what's the difference?
<div> and <marquee> properties
A code needed !!
Oh, my gosh.......!!
how did you learn about html, php or other languages???
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.