The Teacher HTML HTML (3) Cascading Style Sheets
The Teacher HTML Style allows the programmer to decide how some of the tags are displayed. Style sheets allow consistency of display on a number of web pages Style sheets are normally stored in external files. Internal styles over-rule external styles
The Teacher HTML Internal styles Internal styles are defined in the tag. The syntax of a style is…. Tag {property: value } Example : body { color: blue}
The Teacher HTML Internal styles Tags may have more than one property defined…separate with a semi-colon… Example: body { color: blue; font-family: verdana; text-align: center }
The Teacher HTML Internal styles You can set the same property to a group of different tags… Example: h1,h2,h3 {color: green}
The Teacher HTML Classes You can have different classes of the same tag… The paragraph tag for example…you may want two different types of paragraph… p.right {text-align: right} p.center {text-align: center} p.red {color: red}
The Teacher HTML Classes Then you use the class attribute in your HTML document… This pararagraph will be right-aligned This paragraph will be centre-aligned
The Teacher HTML Classes To use more than one class, the syntax is… This paragraph will be red and centred
The Teacher HTML External Style Sheets To use the same styles on a number of different web pages, create the stylesheet using Notepad, save the style sheet with the extension.css The style sheet is linked in using the tag in the section…