MMDT1021 Chapter 8 Notes - page 1
Constructing a Style Rule
This is done by just specifying the name of the tag we want to control. |
Code | Page |
---|---|
Controlling the colors of h1, h2, and h3. |
Result Source |
Don't forget the ";" semicolons separating the property:value pairs If you do, the page will not display correctly. Here is an example of what happens when forgetting the semicolons. |
Result Source |
Constructing a Selector
Code | Page |
---|---|
Here, a bolded word is only given special effects if it is also contained within <p> tags. |
Result Source |
Here bolded words are given special
effects only if they are contained within the class "demo1". A
div class
needs to be referenced by "." period. Divs with the same class name can be used multiple times in the same html document. |
Result Source |
Here is an entire id named "banner" is
given a special look. An div id needs to be referenced by using a "#" pound sign. A div with a particular id name can be used only once in a document. Id names are unique to a document. Id names are used primarily when incorporating Javascript into a web page. Also they can be used as an anchor since they are unique to the document. |
Result Source |
More information on breaking a page up into divisions (<div ), inline spans (<span ), ids (id= ), and classes (class= ) can all be found on pages 67, 68, & 69 in the book. Please read these pages. |
Parent - Sibling Selectors
We won't discuss parent-sibling selectors here because they are not widely supported in all the popular browsers. |