CSS stands for Cascading Style Sheets. It is a style sheet language used for describing the look and formatting of a document written in a markup language. The CSS code your styles from the larger elements to the smaller, nested elements. CSS is made up of two basic basic components. First you must label or identify the item that will have the style applied to it in the HTML file. The you need to write the rules that define that style in the CSS file. A style refers to the look, position, or attributes of something. For example, it could be a font (arial), colour (red), or decoration style (underline, bold, italic).
Here are just some of the things you can accomplish in CSS:
- Font settings and size
- Width and height of objects (<img> or <div>
- Margins and padding
- Position and float (arrange objects on the page, change layout, move things)
- Colour (of objects, text, links, etc)
- Control how links look and behave
- Control how images look
- Make gradients, drop shadows, rounded corners and other basic special effects.
For your CSS file to have any effect on your HTML file you have to link them together. The following code is used to do this: <link href="css/mainstyles.css" rel="stylesheet" type="text/css" />. You place this code in the <head> section just after the closing </title> tag of your HTML document.
CSS uses natural selectors (<h1>, <p> etc), ID tags and classes. Last week I learn’t about <div> tags . They were just invisible boxes but now using CSS you can start to style the <div>’s so that they become visible. To do this you use an ID selector. An ID selector is written #(name that you gave the div in HTML). An example of this is:
#header (identifier)
{(declaration)
width:960px;
height:260px;
background-color:#0C3;
}
Useful link that gives you all the possible selectors you can use in CSS
http://www.w3schools.com/cssref/css_selectors.asp
Useful link that gives you all the possible selectors you can use in CSS
http://www.w3schools.com/cssref/css_selectors.asp
No comments:
Post a Comment