Presentation is loading. Please wait.

Presentation is loading. Please wait.

 a style language that defines layout & appearance of HTML documents  CSS covers fonts, colours, margins, lines, height, width, background images and.

Similar presentations


Presentation on theme: " a style language that defines layout & appearance of HTML documents  CSS covers fonts, colours, margins, lines, height, width, background images and."— Presentation transcript:

1

2  a style language that defines layout & appearance of HTML documents  CSS covers fonts, colours, margins, lines, height, width, background images and positioning  HTML is used to structure content  CSS is used for formatting structured content

3  Consider this screenshot…

4   Name  Description  Part No   250A  Empty box  9BC1932202   251A  5 way backmount frame, earth post and 4 x jumper rings  9BC1932302   250/7A  7 way backmount frame & earth post  9BC1932206  How much actual content?

5   Name  Description  Part No   250A  Empty box  9BC1932202   251A  5 way backmount frame, earth post and 4 x jumper rings  9BC1932302   250/7A  7 way backmount frame & earth post  9BC1932206  Not a lot…

6  control layout of many documents from one single style sheet  more precise control of layout  apply different layout to different media- types (screen, print, etc) Basically just a change of style sheet http://plasfarmcaravanpark.co.uk/ http://townandcountry-carpets.co.uk/

7  Accessibility ◦ Screen readers see content only ◦ Allows use of user style sheets for e.g. increasing font size  File Sizes are smaller  Downloaded once into the browser

8  Inconsistent browser support  Larger initial time commitment  Not perfect & can be buggy but improving

9 Using HTML to set a background colour With CSS the same result can be achieved like this: body {background-color: #FF0000;}

10

11 When setting multiple properties, put them all inside one set of {} with a semi-colon at the end of each body{ background: url("bg.gif"); background-color: #ffffff; background-repeat: repeat-x; }

12 You can even combine properties like this body { background: url("bg.gif") #fff repeat-x; } BUT it makes the CSS harder to understand!

13 Three possible methods  Inline styles ◦ Style info embedded in HTML code  Internal style sheets ◦ Style sheet held in section of html page  External style sheets ◦ CSS held in separate file with css extension BEST!!

14 A new background and font color with inline CSS This is broken This is working'

15 Inline CSS has the highest priority out of external, internal, and inline CSS. This means that you can override styles that are defined in external or internal by using inline CSS BUT Results are little different to previous HTML formatting tags approach! Use only when strictly necessary!

16 Use when 1 page has a different style to others

17 An external style sheet is simply a text file with the extension.css

18 My document My first stylesheet

19 body { background-color: #FF0000; } You can continue to add to this page by increasing the styles


Download ppt " a style language that defines layout & appearance of HTML documents  CSS covers fonts, colours, margins, lines, height, width, background images and."

Similar presentations


Ads by Google