12.09.2015 Views

Boot Camp

Web Authoring Boot Camp - StudioBast

Web Authoring Boot Camp - StudioBast

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Web Authoring <strong>Boot</strong> <strong>Camp</strong><br />

• Style specific things last, like unnumbered list links that have a hover.<br />

• Use CSS commenting between ‘style areas’ to tell yourself what the area is.<br />

Basic styles: body, h1-h6, p<br />

Table styles: table, tr, td, th<br />

Basic links: a:link, a:visited, a:hover, and a:active<br />

Layout items, like div layout styles<br />

Special navigation formats, like rollovers.<br />

Inheritance<br />

CSS styles inherit values from parent styles, hence the cascading in the style sheet name.<br />

This means that if you designate the body text to be black, all text in your whole site will<br />

also be black. You can change that by assigning a different color to a specific selector,<br />

like gray text for a specific header:<br />

body {color:#000;}<br />

h3 {color:#ccc;}<br />

h3.normal {font-weight: normal;}<br />

This makes the header 3 gray instead of black. Then, the class .normal applied to header 3<br />

makes only the turn to normal text rather than the default bold. The<br />

remaining header 3s will still be bold, and the non-bolded header 3 inherits the grey color<br />

from the h3 {color:#ccc;}.<br />

So, when more than one style rules is applied to a web page element, how do you know<br />

which styles will be applied?<br />

• Styles can be inherited from a parent. Some styles, like font family, text-alignment<br />

etc., are automatically inherited by child elements from their parent element (i.e.<br />

by an element contained inside another one).<br />

• Later styles over-rule earlier styles. If you define a style property, and later define<br />

an alternative style property for the same thing, the later definition overrules the<br />

earlier one.<br />

• Styles can combine from different sources. If the later styles or style sheets set<br />

any of the same properties as the previously-defined ones, they would overwrite<br />

the previous styles.<br />

212

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!