Well, I have shown you the boring stuff now I assume you want to get down to the more interesting stuff - properties. Properties are the things that dictate how your page will actually look, and I am going to show you some common text/inline properties here. But do not worry, there is still more boring stuff to come!
font[ [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [ / 'line-height' ]? 'font-family' ] | caption | icon | menu | message-box | small-caption | status-bar | inherit
font-stylenormalitalicobliqueinheritfont-variantnormalsmall-capsinheritfont-weightnormalboldbolderbolder will make it appear as though
you had set it to bold. If you are on the maximum boldness, it will simply use that weight.lighter100 to 900inheritfont-sizexx-small, x-small, small,
medium, large, x-large or
xx-largelarger or smallerlarger the child's font size may for example be 14.2pt.em so that the user can set the font size
larger if they have impaired vision.line-height<div>)
it specifies the line-height for all of its inline child elements.
Values may either be normal, inherit,
length or percentage or any decimal number.
When using a number the UA multiplies this by the font size.
Using normal should be the same as specifying a number of between
1 and 1.2 (depending of the UA).font-familyp { font-family: Verdana, Tahoma, sans-serif; }
You may also encase font-names (but not generic font-families) in single or double quotes,
and you must do this if the font-name contains a space otherwise they will be trimmed.
Generic font families include:
| Font-Family: | Description: | Example fonts: |
|---|---|---|
| serif | Serif fonts have flared edges and tend to be easy to read. Most news-papers tend to use serif fonts. | Times New Roman |
| sans-serif | Sans-serif fonts are similar to serif fonts except that they do not have flared edges. They are usually clean/tasteful and rounded looking. | Tahoma, Verdana, Arial |
| cursive | Cursive fonts tend to have a hand-writing effect due to their joining strokes. | Zapf-Chancery |
| fantasy | Fantasy fonts are highly decorated compared to other font-families. | Studz |
| monospace | Monospaced fonts are those that each character/symbol are of equal width. They are usually used for samples of computer programming code or similar. They are useful when you need to space text out evenly, especially over several lines. | Courier, Courier New |
text-align<div>)
as it will only center the text inside the element (except for a bug in Internet Explorer).
Instead you should consider using the margin property.
Possible property values for text-align include:
leftrightcenterjustifytext-decorationunderline keyword/value. Possible property values include:
noneunderlineoverlineline-through<strike> or <s> tags)blinktext-indent
entities, which may not work properly anyway if the browser window is too small.
Values may either be units or inherit
in which case the value will be the same as the element's parent's property.
For example to indent all all paragraphs by 3 ems you could write:
p { text-indent: 3em; }text-transformuppercase
would make all selected text uppercase, regardless of its original case.
Possible property values include:
capitalizeuppercaselowercasenone: