SlideShare ist ein Scribd-Unternehmen logo
1 von 35
ARTDM 171, Week 5:
   CSS Basics
          Gilbert Guerrero
        gguerrero@dvc.edu
gilbertguerrero.com/blog/artdm-171/
Please turn in homework

• Last weekʼs homework was to create
  a Web page
• Put files in a folder with your lastname
  and first initial
• Example:
       smith-h
        chapter7.html
Letʼs take a quiz!
Cascading Style Sheets
        (CSS)
Cascading Style Sheets

• Code that you add to your Web
  pages
• Separate presentation from structure
CSS Zen Garden
http://www.csszengarden.com
Parts of a Style Sheet
• Style Sheets are made up of CSS Rules
  selector [, selector2, ...]:pseudo-class {
      property: value;
  }
  /* comment */

• Each rule is made up of a Selector and a
  Declaration Block
• Each declaration in the declaration block is
  made up of a Property and a Value
Page Properties...
Dreamweaver fonts + CSS
Basic Stylesheet
<style type="text/css">
<!--
body, td, th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #996600;
}
h1 {
    font-family: Georgia, Times New Roman, Times, serif;  
                                                          
font-size: 16px;
    color: #003366;
}
-->
</style>
CSS Selectors
Tags

• h1 {
      font-family: Georgia, Times, serif;    
      font-size: 16px;
      color: #003366;
  }
• <h1>My Website About Eating
  Food</h1>
ID – attributes within tags
•   Must be unique
•   When used in the <div> tag, separates sections of
    the page: header, nav, content, footer
•   #footer {
        font-family: Georgia, Times, serif;   
        font-size: 16px;
        color: #003366;
    }
•   <div id="footer">(c) 2009, BigShot Productions. All
    rights reserved.</div>
Class – attributes within tags

• Can be used several times on a Web
  page... Be careful of overuse
• .highlight {
      background-color: #FFCC00;
  }
•  <p class="highlight">Today I had
  coffee and did laundry.</p>
Pseudo-classes
    a:link {
        color: #FF0000;
    }
    a:visited {
        color: #00FF00;
    }
    a:hover {
        color: #0000FF;
    }
    <a href="index.html">back to home</a>

•   Be aware of ordering when using pseudo for rollover
    states
Firebug for Firefox
https://addons.mozilla.org/en-
    US/firefox/addon/1843
Using Selectors
Grouped Selectors
body, td, th { 
    color: #000000;
}


h1, h2, h3 { 
    color: #FF0000;
}
Specific tags with id or class
attributes
• This will affect only paragraphs that
  have an attribute class="highlight"
  p.highlight { 
      background-color: #fff; 
  }
  a.selected {
     font-weight: bold;
  }
Descendents
  a img { 
      border: 0; 
  }

• This will affect linked images only
Descendents
  p.highlight a { 
      font-weight: bold; 
  }

• This will affect links within paragraphs
  that have an attribute
  class=“hightlight”
Descendents
  #navigation ul li a:hover {
      background-color: #fff; 
  }

• This will affect links while hovering
  within a list in the navigation
  container
Fonts
Font Sizes
•   Pixels (px)
•   Ems (em)
•   Percentage (%)
•   Points (pt)
•   Picas (pica)
•   Inches (in)
•   Centimeters (cm)
•   Milimeters (mm)
Absolute Font Size: px

• Example:
  font-size: 12px;

• Not proportional to the viewing area. 
  Always the same.
Relative Font Size: em or %

• Example:
  font-size: 1.2em;
  font-size: 120%;

• Proportional to the viewing area.
Relative Font Sizing
•   Relative font sizing can be difficult to use. One strategy:
    •   Browser default sizing for fonts is roughly 16pt. 
    •   62.5% resets the default size to roughly 10pt, which
        makes it easier to do the math
         1em translates 10pt
         1.2em translates to 12pt
    body {
        font-size: 62.5%;
    }
    p{
        font-size: 1.2em; 
    }
Relative Font Sizing

• Nested elements affect each other
• If an element has a font size of 80%
  and is nested within an element that
  also has a font size of 80%, then the
  result is a font size of 64%
• That's 80% of 80%
• This could be a lot smaller than you
  might have wanted.
Embedded, Linked, and
  Inline Stylesheets
Embedded
    <html>
    <head>
    <style type="text/css">
    h1 {
        font-family: Georgia, Times, serif;
    }
    </style>
    </head>
    <body>
    </body>
    </html>
•   Embedded Style Sheet: are placed within the header,
    within a Web page
Linked
    <html>
    <head>
    <link rel="stylesheet" href="css/
       global.css" type="text/css" />
    </head>
    <body> 
    </body>
    </html>
•   Linked Style Sheet: All CSS rules are saved
    in a .css file
Inline
    <html>
    <head>
    </head>
    <body> 
    <p>What color is a cucumber?</p>
    <p style="color:#00FF00;font-
    weight:bold;">A cucumber is green.</p>
    </body>
    </html> 
•   Inline Styles: declarations can be placed within a
    single tag as a style attribute
Combining methods

• Embedded, linked, and inline styles
  can be combined in a single page
Group Projects
  Due March 9
Homework due March 2

• Read chapter “Graphics” in Web
 Style Guide
• Work on Group Projects
 Next week: formatting images for the
 Web
Thank You

Weitere ähnliche Inhalte

Was ist angesagt?

1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introductionapnwebdev
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)AakankshaR
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to csseShikshak
 
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSSThinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSSTJ Stalcup
 
Streamlining Website Development in Dreamweaver
Streamlining Website Development in DreamweaverStreamlining Website Development in Dreamweaver
Streamlining Website Development in Dreamweaverjkchapman
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style SheetsMarc Steel
 
HTML(5) and CSS(3) for beginners - I
HTML(5) and CSS(3) for beginners - IHTML(5) and CSS(3) for beginners - I
HTML(5) and CSS(3) for beginners - Ivincentleeuwen
 
CSS introduction
CSS introductionCSS introduction
CSS introductionCloudTech 
 
Html5 elements-Kip Academy
Html5 elements-Kip AcademyHtml5 elements-Kip Academy
Html5 elements-Kip Academykip academy
 

Was ist angesagt? (19)

Page layout with css
Page layout with cssPage layout with css
Page layout with css
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
 
CSS
CSSCSS
CSS
 
Css
CssCss
Css
 
Artdm171 Week4 Tags
Artdm171 Week4 TagsArtdm171 Week4 Tags
Artdm171 Week4 Tags
 
Html
HtmlHtml
Html
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
CSS Introduction
CSS IntroductionCSS Introduction
CSS Introduction
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSSThinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSS
 
Streamlining Website Development in Dreamweaver
Streamlining Website Development in DreamweaverStreamlining Website Development in Dreamweaver
Streamlining Website Development in Dreamweaver
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
uptu web technology unit 2 Css
uptu web technology unit 2 Cssuptu web technology unit 2 Css
uptu web technology unit 2 Css
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
Basic HTML/CSS
Basic HTML/CSSBasic HTML/CSS
Basic HTML/CSS
 
HTML(5) and CSS(3) for beginners - I
HTML(5) and CSS(3) for beginners - IHTML(5) and CSS(3) for beginners - I
HTML(5) and CSS(3) for beginners - I
 
CSS introduction
CSS introductionCSS introduction
CSS introduction
 
Html5 elements-Kip Academy
Html5 elements-Kip AcademyHtml5 elements-Kip Academy
Html5 elements-Kip Academy
 

Andere mochten auch

Liveblogging as stories unfold
Liveblogging as stories unfoldLiveblogging as stories unfold
Liveblogging as stories unfoldSteve Buttry
 
ARTDM 170, Week 2: GIF Animation
ARTDM 170, Week 2: GIF AnimationARTDM 170, Week 2: GIF Animation
ARTDM 170, Week 2: GIF AnimationGilbert Guerrero
 
Generating Revenue With Integrity
Generating Revenue With IntegrityGenerating Revenue With Integrity
Generating Revenue With IntegritySteve Buttry
 
User Content Webinar
User Content WebinarUser Content Webinar
User Content WebinarSteve Buttry
 
Cleanse camera user guide
Cleanse camera user guideCleanse camera user guide
Cleanse camera user guidegeorge david
 
ARTDM 170, Week 14: Introduction to Processing
ARTDM 170, Week 14: Introduction to ProcessingARTDM 170, Week 14: Introduction to Processing
ARTDM 170, Week 14: Introduction to ProcessingGilbert Guerrero
 
Multimedia Storytelling
Multimedia StorytellingMultimedia Storytelling
Multimedia StorytellingSteve Buttry
 

Andere mochten auch (7)

Liveblogging as stories unfold
Liveblogging as stories unfoldLiveblogging as stories unfold
Liveblogging as stories unfold
 
ARTDM 170, Week 2: GIF Animation
ARTDM 170, Week 2: GIF AnimationARTDM 170, Week 2: GIF Animation
ARTDM 170, Week 2: GIF Animation
 
Generating Revenue With Integrity
Generating Revenue With IntegrityGenerating Revenue With Integrity
Generating Revenue With Integrity
 
User Content Webinar
User Content WebinarUser Content Webinar
User Content Webinar
 
Cleanse camera user guide
Cleanse camera user guideCleanse camera user guide
Cleanse camera user guide
 
ARTDM 170, Week 14: Introduction to Processing
ARTDM 170, Week 14: Introduction to ProcessingARTDM 170, Week 14: Introduction to Processing
ARTDM 170, Week 14: Introduction to Processing
 
Multimedia Storytelling
Multimedia StorytellingMultimedia Storytelling
Multimedia Storytelling
 

Ähnlich wie Artdm171 Week5 Css

Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheetssmithaps4
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheetssmitha273566
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptxMattMarino13
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)Webtech Learning
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflowPeter Kaizer
 
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptxMattMarino13
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSSAmit Tyagi
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshMukesh Kumar
 
Class 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & IdsClass 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & IdsErika Tarte
 
Unit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptxUnit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptxTanu524249
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2Sónia
 
Understanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company indiaUnderstanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company indiaJignesh Aakoliya
 
basic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdfbasic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdfelayelily
 
2 introduction css
2 introduction css2 introduction css
2 introduction cssJalpesh Vasa
 
Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...JebaRaj26
 

Ähnlich wie Artdm171 Week5 Css (20)

ARTDM 171, Week 5: CSS
ARTDM 171, Week 5: CSSARTDM 171, Week 5: CSS
ARTDM 171, Week 5: CSS
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Web
WebWeb
Web
 
Css
CssCss
Css
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptx
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 
CSS
CSSCSS
CSS
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflow
 
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptx
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
css v1 guru
css v1 gurucss v1 guru
css v1 guru
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
 
Class 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & IdsClass 2: CSS Selectors, Classes & Ids
Class 2: CSS Selectors, Classes & Ids
 
Unit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptxUnit-3-CSS-BWT.pptx
Unit-3-CSS-BWT.pptx
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
 
Understanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company indiaUnderstanding CSS for web development by software outsourcing company india
Understanding CSS for web development by software outsourcing company india
 
basic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdfbasic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdf
 
2 introduction css
2 introduction css2 introduction css
2 introduction css
 
Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...Cascading Styling Sheets(CSS) simple design language intended to transform th...
Cascading Styling Sheets(CSS) simple design language intended to transform th...
 

Mehr von Gilbert Guerrero

Designing for Skepticism and Bright Sunlight
Designing for Skepticism and Bright SunlightDesigning for Skepticism and Bright Sunlight
Designing for Skepticism and Bright SunlightGilbert Guerrero
 
ARTDM 171, Week 17: Usability Testing and QA
ARTDM 171, Week 17: Usability Testing and QAARTDM 171, Week 17: Usability Testing and QA
ARTDM 171, Week 17: Usability Testing and QAGilbert Guerrero
 
Artdm 170 week15 publishing
Artdm 170 week15 publishingArtdm 170 week15 publishing
Artdm 170 week15 publishingGilbert Guerrero
 
ARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + ArraysARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + ArraysGilbert Guerrero
 
ARTDM 171, Week 13: Navigation Schemes
ARTDM 171, Week 13: Navigation SchemesARTDM 171, Week 13: Navigation Schemes
ARTDM 171, Week 13: Navigation SchemesGilbert Guerrero
 
Artdm170 week12 user_interaction
Artdm170 week12 user_interactionArtdm170 week12 user_interaction
Artdm170 week12 user_interactionGilbert Guerrero
 
Artdm 171 Week12 Templates
Artdm 171 Week12 TemplatesArtdm 171 Week12 Templates
Artdm 171 Week12 TemplatesGilbert Guerrero
 
ARTDM 171, Week 10: Mood Boards + Page Comps
ARTDM 171, Week 10: Mood Boards + Page CompsARTDM 171, Week 10: Mood Boards + Page Comps
ARTDM 171, Week 10: Mood Boards + Page CompsGilbert Guerrero
 
ARTDM 170, Week 10: Encapsulation + Paper Prototypes
ARTDM 170, Week 10: Encapsulation + Paper PrototypesARTDM 170, Week 10: Encapsulation + Paper Prototypes
ARTDM 170, Week 10: Encapsulation + Paper PrototypesGilbert Guerrero
 
ARTDM 171, Week 9: User Experience
ARTDM 171, Week 9: User ExperienceARTDM 171, Week 9: User Experience
ARTDM 171, Week 9: User ExperienceGilbert Guerrero
 
ARTDM 171, Week 7: Remapping Cyberspace
ARTDM 171, Week 7: Remapping CyberspaceARTDM 171, Week 7: Remapping Cyberspace
ARTDM 171, Week 7: Remapping CyberspaceGilbert Guerrero
 
ARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting InteractivityARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting InteractivityGilbert Guerrero
 
Artdm170 week6 scripting_motion
Artdm170 week6 scripting_motionArtdm170 week6 scripting_motion
Artdm170 week6 scripting_motionGilbert Guerrero
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionGilbert Guerrero
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionGilbert Guerrero
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionGilbert Guerrero
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionGilbert Guerrero
 

Mehr von Gilbert Guerrero (20)

Designing for Skepticism and Bright Sunlight
Designing for Skepticism and Bright SunlightDesigning for Skepticism and Bright Sunlight
Designing for Skepticism and Bright Sunlight
 
ARTDM 171, Week 17: Usability Testing and QA
ARTDM 171, Week 17: Usability Testing and QAARTDM 171, Week 17: Usability Testing and QA
ARTDM 171, Week 17: Usability Testing and QA
 
Artdm 171 week15 seo
Artdm 171 week15 seoArtdm 171 week15 seo
Artdm 171 week15 seo
 
Artdm 170 week15 publishing
Artdm 170 week15 publishingArtdm 170 week15 publishing
Artdm 170 week15 publishing
 
ARTDM 171, Week 14: Forms
ARTDM 171, Week 14: FormsARTDM 171, Week 14: Forms
ARTDM 171, Week 14: Forms
 
ARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + ArraysARTDM 170, Week 13: Text Elements + Arrays
ARTDM 170, Week 13: Text Elements + Arrays
 
ARTDM 171, Week 13: Navigation Schemes
ARTDM 171, Week 13: Navigation SchemesARTDM 171, Week 13: Navigation Schemes
ARTDM 171, Week 13: Navigation Schemes
 
Artdm170 week12 user_interaction
Artdm170 week12 user_interactionArtdm170 week12 user_interaction
Artdm170 week12 user_interaction
 
Artdm 171 Week12 Templates
Artdm 171 Week12 TemplatesArtdm 171 Week12 Templates
Artdm 171 Week12 Templates
 
ARTDM 171, Week 10: Mood Boards + Page Comps
ARTDM 171, Week 10: Mood Boards + Page CompsARTDM 171, Week 10: Mood Boards + Page Comps
ARTDM 171, Week 10: Mood Boards + Page Comps
 
ARTDM 170, Week 10: Encapsulation + Paper Prototypes
ARTDM 170, Week 10: Encapsulation + Paper PrototypesARTDM 170, Week 10: Encapsulation + Paper Prototypes
ARTDM 170, Week 10: Encapsulation + Paper Prototypes
 
ARTDM 171, Week 9: User Experience
ARTDM 171, Week 9: User ExperienceARTDM 171, Week 9: User Experience
ARTDM 171, Week 9: User Experience
 
ARTDM 171, Week 7: Remapping Cyberspace
ARTDM 171, Week 7: Remapping CyberspaceARTDM 171, Week 7: Remapping Cyberspace
ARTDM 171, Week 7: Remapping Cyberspace
 
ARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting InteractivityARTDM 170, Week 7: Scripting Interactivity
ARTDM 170, Week 7: Scripting Interactivity
 
Artdm170 week6 scripting_motion
Artdm170 week6 scripting_motionArtdm170 week6 scripting_motion
Artdm170 week6 scripting_motion
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
 
Artdm171 Week6 Images
Artdm171 Week6 ImagesArtdm171 Week6 Images
Artdm171 Week6 Images
 
Artdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting MotionArtdm170 Week6 Scripting Motion
Artdm170 Week6 Scripting Motion
 

Kürzlich hochgeladen

Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 

Kürzlich hochgeladen (20)

Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 

Artdm171 Week5 Css

  • 1. ARTDM 171, Week 5: CSS Basics Gilbert Guerrero gguerrero@dvc.edu gilbertguerrero.com/blog/artdm-171/
  • 2. Please turn in homework • Last weekʼs homework was to create a Web page • Put files in a folder with your lastname and first initial • Example:      smith-h chapter7.html
  • 5. Cascading Style Sheets • Code that you add to your Web pages • Separate presentation from structure
  • 7. Parts of a Style Sheet • Style Sheets are made up of CSS Rules selector [, selector2, ...]:pseudo-class { property: value; } /* comment */ • Each rule is made up of a Selector and a Declaration Block • Each declaration in the declaration block is made up of a Property and a Value
  • 9. Basic Stylesheet <style type="text/css"> <!-- body, td, th {     font-family: Arial, Helvetica, sans-serif;     font-size: 12px;     color: #996600; } h1 {     font-family: Georgia, Times New Roman, Times, serif;     font-size: 16px;     color: #003366; } --> </style>
  • 11. Tags • h1 {     font-family: Georgia, Times, serif;     font-size: 16px;     color: #003366; } • <h1>My Website About Eating Food</h1>
  • 12. ID – attributes within tags • Must be unique • When used in the <div> tag, separates sections of the page: header, nav, content, footer • #footer { font-family: Georgia, Times, serif;    font-size: 16px;     color: #003366; } • <div id="footer">(c) 2009, BigShot Productions. All rights reserved.</div>
  • 13. Class – attributes within tags • Can be used several times on a Web page... Be careful of overuse • .highlight {     background-color: #FFCC00; } •  <p class="highlight">Today I had coffee and did laundry.</p>
  • 14. Pseudo-classes a:link {     color: #FF0000; } a:visited {     color: #00FF00; } a:hover {     color: #0000FF; } <a href="index.html">back to home</a> • Be aware of ordering when using pseudo for rollover states
  • 17. Grouped Selectors body, td, th {      color: #000000; } h1, h2, h3 {      color: #FF0000; }
  • 18. Specific tags with id or class attributes • This will affect only paragraphs that have an attribute class="highlight" p.highlight {      background-color: #fff;  } a.selected { font-weight: bold; }
  • 19. Descendents a img {      border: 0;  } • This will affect linked images only
  • 20. Descendents p.highlight a {      font-weight: bold;  } • This will affect links within paragraphs that have an attribute class=“hightlight”
  • 21. Descendents #navigation ul li a:hover {     background-color: #fff;  } • This will affect links while hovering within a list in the navigation container
  • 22. Fonts
  • 23. Font Sizes • Pixels (px) • Ems (em) • Percentage (%) • Points (pt) • Picas (pica) • Inches (in) • Centimeters (cm) • Milimeters (mm)
  • 24. Absolute Font Size: px • Example: font-size: 12px; • Not proportional to the viewing area.  Always the same.
  • 25. Relative Font Size: em or % • Example: font-size: 1.2em; font-size: 120%; • Proportional to the viewing area.
  • 26. Relative Font Sizing • Relative font sizing can be difficult to use. One strategy: • Browser default sizing for fonts is roughly 16pt.  • 62.5% resets the default size to roughly 10pt, which makes it easier to do the math  1em translates 10pt  1.2em translates to 12pt body {     font-size: 62.5%; } p{     font-size: 1.2em;  }
  • 27. Relative Font Sizing • Nested elements affect each other • If an element has a font size of 80% and is nested within an element that also has a font size of 80%, then the result is a font size of 64% • That's 80% of 80% • This could be a lot smaller than you might have wanted.
  • 28. Embedded, Linked, and Inline Stylesheets
  • 29. Embedded <html> <head> <style type="text/css"> h1 {     font-family: Georgia, Times, serif; } </style> </head> <body> </body> </html> • Embedded Style Sheet: are placed within the header, within a Web page
  • 30. Linked <html> <head> <link rel="stylesheet" href="css/ global.css" type="text/css" /> </head> <body>  </body> </html> • Linked Style Sheet: All CSS rules are saved in a .css file
  • 31. Inline <html> <head> </head> <body>  <p>What color is a cucumber?</p> <p style="color:#00FF00;font- weight:bold;">A cucumber is green.</p> </body> </html>  • Inline Styles: declarations can be placed within a single tag as a style attribute
  • 32. Combining methods • Embedded, linked, and inline styles can be combined in a single page
  • 33. Group Projects Due March 9
  • 34. Homework due March 2 • Read chapter “Graphics” in Web Style Guide • Work on Group Projects Next week: formatting images for the Web

Hinweis der Redaktion