DONNA'S CSS Week 5


Quiz Answers~Week 5


1. To set different margins for all sides of an element, you must first remember that the order is clockwise, therefore top, right, bottom, left. You would enter IMG{margin: 5px 10px 15px 20px;} in your stylesheet, if those were the numbers of pixels you wished to use or replacing those numbers with the margins you want. Below is an example

baby angel sleeping

2. Margins DO collapse when they have adjacent vertical margins, this statement is TRUE!

3. If you use margins and/or padding without a hanging indent your text will disappear!

4. FALSE. If you accidentally define 2 different rules for the same element in the same style sheet, the one furthest down the page will be the one applied, this being the rule closest to the actual text.

5. Cascade refers to the rule that most of the time whatever is closest to the text you want to affect is what is applied. Style defined with the inline style attribute carries more weight than embedded style and embedded style carries more weight than linked style. There is an exception to this rule; rules marked with !important are given the highest priority no matter where they lie in the hierarchy.

6. See the last part of #5 for this answer!

7. Display makes it possible to change the structural definiton of your page.

a) Display:inline, if used in your stylesheet would give you no blank lines between your paragraphs because the p tag has just been changed to an inline element. Inline elements do not force anything to start on a new line. They can be children of any other element. This could be used to your advantage only if you wanted no line breaks in your page, such as you might find in a journal atricle, rather than a letter style format.

b) Display:block, if used in your stylesheet would put everything on it's own line, this would be advantageous if you were working with images and therefore every image would be put on it's own line. This would make the presentation nicer and would be easier than coding for each individual image, especially with a graphic intesnive page.



Here is an example of aligning text and images, so that in this case they are centered on the page.This birdhouse was made using some graphics and tubes in PSP.


Designed by Donna

  Week 1 Lesson
Week 2 Lesson
Week 3 Lesson
Week 4 Lesson
Week 6 Lesson

  Home~~~~ Email me!