css basics

15

Upload: ehorner

Post on 13-Jun-2015

666 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Css Basics
Page 2: Css Basics

Separates Style from Content You don’t have to be both a great

designer and a content expert!Maintenance is EasierSite AccessibilityCurrent Site

Page 3: Css Basics

HTML 3.2 <font color="#0000ff"><h4>a blue

headline</h4></font>XHTML 1.0

HTML <h4>another blue headline</h4> Style h4 {color : blue}

Page 4: Css Basics

Not best practice▪ <h4 style="color: #0000ff;">a blue

headline</h4>

Page 5: Css Basics

Internal (Embedded)<style type="text/css" media="all"><!--p { font: 1em Times serif; color: #c00; }h1 { font: 2em Times serif; color: #f00; }--></style>

Internal (Embedded)<h1>Help!</h1><p>Don’t forget that this is the content of the page</p>

HEAD BODY

Page 6: Css Basics
Page 7: Css Basics

selector {property : value;} h1 {color: red;}

h2 {color: red;} h1, h2 {color: red;}

Page 8: Css Basics

H1, H2, P .notes .glossary

Page 9: Css Basics

Block <div>, <p>, <h1>, <form>, <ul>, <li>▪ Always begin on a new line▪ Height, Margins can be changed▪ Width 100% of parent

Inline <span>, <a>, <label>, <input>, <img>,

<strong>, <em>▪ Begin on same line▪ Height, Margins cannot be changed▪ Width can’t be changed.

Page 10: Css Basics

DIVs for DIVisions of logical contentSPANs for exceptions to the rules

Styles Class – multiple elements ID – one element

Name Styles & Classes correction No starting with # or non-alpha

Style Larger elements firsthttp://webdesign.about.com/od/css/a/aa071204.htm

Page 11: Css Basics

/* Structure */ /* Typography */ /* Links */ /* Lists, images, etc. */

http://www.blogherald.com/2006/09/08/css-tips-and-tricks/

Page 12: Css Basics

Font-family:Font-weight:Font-size:Line-height:Font-color:

Page 13: Css Basics

html,body { margin: 0px; padding: 0px; border: 0px; }

Page 14: Css Basics

body { font-size: 62.5% } Now continue to use ems for the rest of

your font sizes

Page 15: Css Basics

Shorthand for Margins, Padding, Borders Top Right Bottom Left