![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 16
Rep Power: 0
![]() |
changing font style
how do you change the font style in an html document?
|
|
|
|
|
|
#2 |
|
Programmer
|
I think the most common way nowadays is to use the style attribute. Example:
<p style="font-family: Verdana; font-size: 10pt; color: #0000FF"> Your text goes here. </p> http://www.w3schools.com has some very good information on HTML. The method I have used is CSS (Cascading Style Sheets), so look it up if you need more information. There are other ways, but I feel this is most common. kirkl_uk |
|
|
|
|
|
#3 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
If you're changing all the font settings, it's quicker to do:
style="font: Verdana 10pt #0000FF" |
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 317
Rep Power: 4
![]() |
The old-school method (probably officially deprecated now) is with the FONT tag:
<FONT face="Helvetica,Arial"> <H2>Old School Font Switch</H2> </FONT> Just for an alternative view. It's worth bearing in mind that you should list more than one font family, separated with commas; not all systems have all fonts and if you specify a font that the user's browser doesn't have, it'll just use the default. If you have provided a list, the browser will use the first font in the list that it has available. So for a Sans Serif font, you could do: <P style="font-family: Sans, Helvetica, Arial">foo</P> Sans takes care of a lot of systems. It's a rare Mac that doesn't have Helvetica, and Windows machines will manage with Arial if they don't have the other two. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|