Sunday 3 April 2016

CSS

Cascading Style Sheet

HTML is for content, then CSS is for PRESENTATION.
more clear explanation, CSS is to beautify.

Why CSS?
1. allow for much richer document appearances than HTML
2. reduce workload in HTML.
3. use same style on multiple pages.
4. reduce page download size.



CSS Syntax


Selector - elements on HTML page.


Ways of inserting CSS into HTML
1. External Style Sheet

  •     style apply to many pages.
  •     change the look of entire Web site by changing only one file. <<<advantage
  •     <link>

2. Internal Style Sheet

  • single document have unique style
  • have to edit one by one <<<disadvantage
  • inside the <head>

3. Inline Style

  • loses many advantages of style sheets by mixing content with presentation
  • use the style attribute in the relevant tag.
  • <p> </p>

4. Mix all three of the methods listed in above.


CSS selectors

No comments:

Post a Comment