1 / 9

CSS Continued

CSS Continued. 1 February 2011. Agenda. Pseudo-elements Centering Tables Classes and ids. Pseudo-elements. Characteristics of tags that can have their own attributes In CSS: tag:pseudo -element In HTML: not visible Examples: a: hover, a:visited p:first-line, p:first-letter

helen
Download Presentation

CSS Continued

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSS Continued 1 February 2011

  2. Agenda • Pseudo-elements • Centering • Tables • Classes and ids

  3. Pseudo-elements • Characteristics of tags that can have their own attributes • In CSS: tag:pseudo-element • In HTML: not visible • Examples: • a: hover, a:visited • p:first-line, p:first-letter • :before, :after • w3schools

  4. Centering • Generally margin-left: auto; margin-right: auto; • Images: need to add display: block;

  5. Tables • Need to format the parts • Borders • Centering tables vs. text

  6. Multiple Styles: Classes • HTML: class=“name” • Names may define format OR content • Either works • CAN apply multiple classes to the same tag • Multiple ways to define • Style that applies to many elements • Style that applies to only one element • Style that only applies in certain contexts

  7. Classes for many elements • HTML: class=“name” • CSS: .name • Particularly useful for color, font info, …

  8. Single Tag Selector • Can define it for a specific selector • Useful if you want to group attributes but slightly different • HTML: class=“name” • CSS: tag.name

  9. Nested Selector • Only applies within context • Avoids putting class= everywhere! • Useful for, • Define tr and td within a table class • Define links only within a list class • Define any formatting within a div • HTML: class=“name” only for encompassing • CSS: tag.name tag

More Related