CSS Shorthand, Selecting Elements by Context & Floats

In: Uncategorized

12 Jan 2009

Tonight in class we learned how to read/write CSS Shorthand and use floats.  Here is an overview.

CSS Shorthand
Check out this CSS Reference at W3Schools.com for a list of all the shorthand.  The shorthand notation is given at the top of each section. http://www.w3schools.com/css/css_reference.asp

Selecting Elements by Context
You can select nested elements in context:
div ul li a { background-color:red; } which would target links within an unordered list which is inside a div element. <div> <ul><li><a href=”">Link</li></ul></div>

Floats
When working with floats remember that the element is moved out of normal flow causing any elements below it to slide up under it.  Use clear: both;  (left or right) to push the elements back down below the floated element.
http://www.w3schools.com/css/pr_class_float.asp


Share

Comment Form

Follow Me

    Related Links

    RSS See My Latest Photography