Do you want to use the newest technology to style your web pages? Here's how!
Steps
-
Understand how css works with HTML. For example:
<span style="(css)">Text</span>
Almost any HTML tag can include "style," such asp
ordiv
What goes in between the quotes is the CSS part. -
To change text font, use css'
font-family
For example:<span style="font-family:times;">Text</span>
will cause "Text" to use the Times font.Advertisement -
To set an order of preference, in case a particular font is not on a person's computer, use commas to separate font names. For example:
<span style="font-family:times, georgia, serif;">Text</span>
will cause "Text" to use the Times font. If times is not available, Georgia will be used. If neither Times nor Georgia are available, a generic serif font will be used. -
To set text color, use css'
font
For example:<span style="font:red;">Text</span>
will cause "Text" to be red. You can use any valid HTML color name in the place of "red." You can also use a hex code. For example:<span style="font:#FFFFFF;">Text</span>
will cause "Text" to be white.Advertisement
Expert Q&A
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
Tips
- Make sure all quotes, colons, and other symbols are in the correct places; otherwise, you may not receive an expected result.Thanks
- You may want to test your code in multiple browsers, to make sure that it works in as many as possible.Thanks
Advertisement
About this article
Thanks to all authors for creating a page that has been read 31,493 times.
Advertisement