Css selectors



Yüklə 254,36 Kb.
səhifə1/2
tarix15.07.2022
ölçüsü254,36 Kb.
#117403
  1   2
CSS Lab

CSS Selectors

  • Selector Type
    • Element selector
    • Grouped selectors – use comma
    • Descendant selectors – use space
    • Id selectors – use # character
    • Class selectors – use . Character
    • * - to apply for all

Combinator

  • Descendant selector(space)
  • Child selector (>)
  • Adjacent sibling selector(+)
  • General sibling selector(

Cont’d

  • Note: class values are case sensitive
  • To prevent a specific rule from being overridden you can assign it “important” with the !important indicator
  • Example

    p {color : blue !important}

Attaching the styles to the Document

    • Inline style sheet
    • red
    • Embedded style sheet