Cascading style sheet can be used to control the format of the website. They can change many things such as font,background colour and etc. They are in a separate file so that they can be used on the main web page. so this means that if changes need to be made, the css will only need to be changed and not the html, which would be much harder to do.
the CSS rule has two main parts:
- a selector
- and one or more declarations
we had to learn how to add a list of CSS properties- background and text colour:
- colour
- background-colour
- bacground-image
- background-repeat
- background-attachment
- background-position
- font-family
- font-size
- font-weight
- font-height
- etc......
links can be styled in the same way as text so colour and font can be changed, but links also can be styled depnding on the state they are in, the four states are:
- a:link
- a:visiting
- a:hover
- a:active
for example
#navigation{
float:left;
width:900px;
background:#333;
}
#navigation ul
{
margin:0;
padding:0;