Here's the basic format to follow and you just plug
in whatever you want to use.
Here's the basic format:
TAG {definition; definition; definition}
Here's what a line defining the style for the <H2> tag looks like:
H2 {font-size: 16pt; font-style: italic; font-family: arial}
NOTICE! Here's a few things I'd like to point out:
-
Notice the symbol before the definition is a { not a ( or a ].
-
Notice the spaces! You don't need to leave them, but it helps you to be
more able to read your style sheets later. Don't forget the semi-colons between each definition. -
Notice that each definition is separated by a semi-colon, but each definition contains a colon.
You can use many definitions. You can use many Style Sheet commands to affect the same H2
tag, if you want. Just remember to separate each definition by a semi-colon.
Which HTML Tags Can I Define?
As far as I know, you can define any HTML tag. Now, some
definitions won't work with some tags.
For example, a font definition obviously won't work with an HR tag.
I see style sheets using these following tags the most:
- H1 through H6
- P
- BODY
- A:link (That denotes the unvisited link)
- A:visited (That denotes the visited link)
- A:hover (That denotes the state of a moused-over link)
- DIV (That denotes a division of the page)