CSS: Favorites

The CSS Universal Selector (*) selects all the HTML elements on the page

The Grouping Selector is performed by using commas between elements with the same code.

Backgrounds

  • background-color: colorName
  • background-image: url(“location”)
  • background-repeat: repeat-x/y – make it so background image is only represented horizontally or vertically.
  • background-repeat: no repeat – make it so background image is only showed once

outline-style: solid/double/outset
outline-color: red/blue…….

color: colorName – Changes the color text

border: [#]px: colorName – Places a border around the text you want

Image Sprites – if you want any tabs to have sprites, you can use image sprites

Specificity Hierarchy

Every selector has its place in the specificity hierarchy. There are four categories which define the specificity level of a selector:

  • Inline styles – An inline style is attached directly to the element to be styled. Example: <h1 style=”color: #ffffff;”>.
  • IDs – An ID is a unique identifier for the page elements, such as #navbar.
  • Classes, attributes and pseudo-classes – This category includes .classes, [attributes] and pseudo-classes such as :hover, :focus etc.
  • Elements and pseudo-elements – This category includes element names and pseudo-elements, such as h1, div, :before and :after.

Leave a comment

Design a site like this with WordPress.com
Get started