Website Design, Development and Consulting
In: Uncategorized
12 Jan 2009Tonight 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