• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
CSS Fundamentals
 

CSS Fundamentals

on

  • 3,515 views

Fundamentals of CSS covering the different types of tags and

Fundamentals of CSS covering the different types of tags and

Statistics

Views

Total Views
3,515
Views on SlideShare
3,162
Embed Views
353

Actions

Likes
2
Downloads
115
Comments
1

2 Embeds 353

http://planetoftheweb.com 282
http://www.planetoftheweb.com 71

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • The link tag establishes relationships between the current document and other documents. It is almost always used to specify external style sheets. The rel attribute defines the type of relationship. The type attribute specifies the MIME type (the format of the text file) and the href attribute, the location of the file.
  • DOM (Document Object Model)

CSS Fundamentals CSS Fundamentals Presentation Transcript

  • CSS Fundamentals
  • What is CSS?
    • Cascading Style Sheets
    • Rules that define how HTML elements should look
    • body {background:black;}
    • Cascades part determines the order the rules are applied in
  • Types of Style Sheets
    • Browser -Applies some styles by default
    • User -Some browsers allow you to create your own styles.
    • Author -Websites can also have style sheets...these are the ones you'll be doing.
    • selectors select elements to be styled
    • declaration tells browser how to style
    • property is what you want to modify
    • value is the option you want for the property
    What does it look like?
      • <style>
        • em { color:red; font-weight:bold; }
      • </style>
      • declaration
      • selector
      • property
      • value
  • Where does CSS go
    • Inline style=&quot;&quot; attribute - Only good for one tag
    • Embedded <style> - Good for the whole page
    • External <link rel=&quot;stylesheet&quot; href=&quot;&quot; /> - Many Pages
    • When you need to share code
    • Only affects a specific tag
    Inline <em style=&quot;color:red;&quot;>dog</em>
    • Uses the <style> tag
    • Affects the current page
    • Uses selectors to specify which tags to affect
    Embedded
      • <style> em { color: green; font-size:18px;} </style>
    • Can affect a multitude of documents
    • Uses a separate file that must be linked to
    • The CSS file does NOT need <STYLE> tag
    External <link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;my.css&quot; />
  • HTML Color Modes
    • Can use Color Names like Black, Red, Blue
    • Can use Red, Green and Blue values from Photoshop
    • To be more specific, use Hexadecimal codes #FFCC00
    • Can be shortened to three letters if they're the same #FC0
    • Newer browsers can use rgba(0,0,0,0.5);
    • Children inherit styles from parent
    • BODY is the big daddy
    Inheritance body { font-family:verdana; } p { font-size:10px;}
  • SPECIFICITY
    • Which rules take over when there's more than one
    • Browsers always deal with multiple style sheets
    • Browser/User/Author style sheet/External/embedded/inline
    • If two rules conflict, generally the later rule wins
    <style>em { color: red; }</style> <p>The quick <em style=&quot;color:green;&quot;>fox</em>.</p>
  • Common Selectors
    • Type Selectors: em {color: blue; }
    • Class Selectors: .wrapper {background-color: #CFC;}
    • ID Selectors: #content {width:960px;}
    • Descendant Selectors: p em {color:red;}
  • Advanced Selectors
    • Child Selectors: div>em {color:red;}
    • Universal Selector: * {color:red;}
    • Adjacent Sibling: h1+h3 {color:red;}
    • Attribute Selectors: a[href=&quot;&quot;],img[alt] {color:red;}
  • Clean HTML is Crucial
    • DOM (Document Object Model)
    • The Order of Things
  • Pseudo Elements
    • Pseudo Classes: :hover,:first-child
    • Pseudo Elements: :first-line, :first-letter
    • Insertion Elements: :before, :after
  • Multiple Class Selectors
    • You can combine multiple classes by separating them by spaces &quot;wrapper mod&quot;
  • Class Shortcuts
    • Font
    • Background
    • Border
  • The generic Tags
    • Span-Inline
    • DIV-Block Level
  • The Box Model
    • Inline vs Block
    • Margin
    • Border
    • Padding
  • Floating
    • To the Right or to the Left
    • The container problem
    • Fixing it with the mod class in html5reset
  • Positioning
    • Static-Normal positioning of objects
    • Fixed-Fixed to the browser window
    • Relative-Relative to it's current position, but can be moved
    • Absolute-Relative to the last relatively positioned object, if one is not present, then works like Fixed...relative to the window.
    • Z-index
  • The End