SlideShare a Scribd company logo
1 of 42
Download to read offline
Class 2 Css: seleCtors,
    Classes & ids
Web Design , gR APH -327 1- 01
Instructor: Erika Tarte
Rhode Island School of Design
Wintersession 2011
webpage
from web content to webpage

In addition to content, webpages contain hidden information that help browsers interpret
structure, meaning, style, interactions, etc.

Most of the visible information takes place in the body of the HTML document, while most
of the hidden formation happens in the head of the HTML document.

Some information happens in external files, like CSS and JavaScript.

We link to these files in the head of the HTML document.
basic html webpage

<html>

<head>

<title>Document Title</title>

</head>

<body>

...

</body>

</html>
Css
what’s css?

CSS Stands for Cascading Style Sheet

Purpose

   HTML tells us what to display
   CSS tells us how to display

Format

   Simple text file
   Contains rules for displaying HTML
types of style sheets

Inline Styles

   defined within an individual tag
   with a lot of content starts to become inefficient

Internal styles

   defined at the top of each individual page
   with a lot of pages, starts to become inefficient

External styles

   defined once for your whole site
   all of your html pages link to the same file
   extremely efficient (and its what we’ll do in this class)
why external?

Central definition of visual style
   make one change, the entire site is updated
   can be reused on any number of pages

Developers and designers can work independently

Same content can be restyled for lots of different media
  web
  print
  mobile phone
  iPod/iPhone/iPad
characteristics

Cascading
   style rules are applied in order
   last definition takes precedence over the first

Order of priority
   1 browser default          lowest priority
   2 external styles
   3 internal styles
   4 inline styles            highest priority
linking a css file to your html file

The only change in the HTML file is to add a line of code at the top:

   <link rel=”stylesheet” type=”text/css” href=”styles.css” />

Tells browser to include a style sheet called styles.css

You can name the file anything you want (webstyles.css, printstyles.css, awesome.css)

Include the <link> tag just before the </head> tag in your HTML.
basic html webpage w/ link to css file

<html>

<head>

<title>Document Title</title>

<link rel=”stylesheet” type=”text/css” href=”styles.css” />

</head>

<body>

...

</body>

</html>
linking your first file demo

1 Create a text file and save it as styles.css

2 Add this line to your HTML, right before the </head> tag:

   <link rel=”stylesheet” type=”text/css” href=”styles.css” />

3 Start writing CSS rules in your styles.css file
syntax
be prepared...

There are many style properties, don’t worry about memorizing them!

Keep a reference open while coding (www.w3schools.com)
css syntax: vocabulary

selector = what you are defining

curly brackets { } = begin & end of rules for selector

property = set of display properties you can change

value = what you are changing the property to

semicolon ; = ends each rule
css syntax


     selector {
       property: value;
       property: value;
     }
css syntax

selector {            selec toR is the html element these rules will change

   property: value;
   property: value;
}
css syntax

selector {
   property: value;   PRoPeRt y is a display characteristic you are writing a
                      rule for. Each selector can have multiple properties, and
   property: value;   some selectors have very specif ic properties.
}
css syntax

selector {
   property: value;   VAlue is the display characteristic that you want to apply
                      to the property
   property: value;
}
css syntax

sandwich {
   cheese: cheddar;
   bread: rye;
   condiment: mustard;
   condiment-style: spicy-brown;
}
css syntax

h1 {
  font-family: Helvetica;
  font-size: 36px;
  font-weight:bold;
  text-transform:uppercase;
  color:#000000;
}
Classes & ids
html class & id attributes

These 2 attributes give you more control over the elements while using CSS

No inherent styles or properties

Different elements can share the same class

IDs are unique, and different elements can’t share them
html class & id attributes

<a href="http://google.com" class="button">Link</a>

<a href="http://google.com" id="button1">Link</a>
css class & id selectors

.button {
    font-size: 12px;
    color: #ff0000;
    text-decoration: none;
 }

#button1 {
  font-size: 12px;
  color: #ff0000;
  text-decoration: none;
  background-color: #ffff00;
}
html class & id attributes

<a href="http://google.com" class="button">Link</a>

<a href="http://google.com" class=”button” id="button1">Link</a>
css class & id selectors

.button {
    font-size: 12px;
    color: #ff0000;
    text-decoration: none;
 }

#button1 {
  font-size: 12px;
  color: #ff0000;
  text-decoration: none;
  background-color: #ffff00;
}
css class & id selectors

.button {
    font-size: 12px;
    color: #ff0000;
    text-decoration: none;
 }

#button1 {
  font-size: 12px;
  color: #ff0000;
  text-decoration: none;
  background-color: #ffff00;
}
css class & id selectors

.button {
    font-size: 12px;
    color: #ff0000;
    text-decoration: none;
 }

#button1 {
  background-color: #ffff00;
}
Color
color values

rgb (red, green, blue)
   values 0 to 255
   additive color
   black: 0,0,0
   white: 255,255,255

hexadecimal or “hex"
   encoded value of rgb
   black: #000000
   white: #FFFFFF
rgb value
hexadecimal (hex) value
css property: color

h1 {
       color: rgb(255,255,255);
       color: #ffffff;
  }
css property: background-color

h1 {
       color: #ffffff;
       background-color: #000000;
  }
typography
fonts

Browsers only display fonts installed on the user’s computer (with some recent exceptions)

To define fonts, the font-family: css property is used

Designers use font-stacking to create prioritized lists of fonts to display

(A safety net, incase the first desired typeface is unavailable)

Start with a very specific typeface, move to a generic classification
css property: font-family

h1 {
       color: #ffffff;
       background-color: #000000;
       font-family: Akkurat, Helvetica, sans-serif;
  }
css property: font-size

h1 {
       color: #ffffff;
       background-color: #000000;
       font-family: Akkurat, Helvetica, sans-serif;
       font-size: 72px;
  }
css property: font-weight

h1 {
       color: #ffffff;
       background-color: #000000;
       font-family: Akkurat, Helvetica, sans-serif;
       font-size: 72px;
       font-weight: normal;
  }
css property: letter-spacing

h1 {
       color: #ffffff;
       background-color: #000000;
       font-family: Akkurat, Helvetica, sans-serif;
       font-size: 72px;
       font-weight: normal;
       letter-spacing: 4px;
  }
css property: text-transform

h1 {
       color: #ffffff;
       background-color: #000000;
       font-family: Akkurat, Helvetica, sans-serif;
       font-size: 72px;
       font-weight: normal;
       letter-spacing: 4px;
       text-transform: uppercase;
  }

More Related Content

What's hot (19)

Css
CssCss
Css
 
Css
CssCss
Css
 
Supercharged HTML & CSS
Supercharged HTML & CSSSupercharged HTML & CSS
Supercharged HTML & CSS
 
Css
CssCss
Css
 
Css
CssCss
Css
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Introduction to web design discussing which languages is used for website des...
Introduction to web design discussing which languages is used for website des...Introduction to web design discussing which languages is used for website des...
Introduction to web design discussing which languages is used for website des...
 
CSS
CSSCSS
CSS
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
CSS3 Introduction
CSS3 IntroductionCSS3 Introduction
CSS3 Introduction
 
CSS Foundations, pt 1
CSS Foundations, pt 1CSS Foundations, pt 1
CSS Foundations, pt 1
 
Css
CssCss
Css
 
Styling with CSS
Styling with CSSStyling with CSS
Styling with CSS
 
Css
CssCss
Css
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
 
CSS - LinkedIn
CSS - LinkedInCSS - LinkedIn
CSS - LinkedIn
 
An Introduction to Cascading Style Sheets (CSS3)
An Introduction to Cascading Style Sheets (CSS3)An Introduction to Cascading Style Sheets (CSS3)
An Introduction to Cascading Style Sheets (CSS3)
 
CSS
CSSCSS
CSS
 
Intro to HTML + CSS
Intro to HTML + CSSIntro to HTML + CSS
Intro to HTML + CSS
 

Similar to Class 2: CSS Selectors, Classes & Ids

Similar to Class 2: CSS Selectors, Classes & Ids (20)

Week3 css
Week3 cssWeek3 css
Week3 css
 
PHP HTML CSS Notes
PHP HTML CSS  NotesPHP HTML CSS  Notes
PHP HTML CSS Notes
 
Web Typography
Web TypographyWeb Typography
Web Typography
 
2_css.pptx
2_css.pptx2_css.pptx
2_css.pptx
 
2_css.pptx
2_css.pptx2_css.pptx
2_css.pptx
 
Unit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.pptUnit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.ppt
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
 
HTML & CSS 2017
HTML & CSS 2017HTML & CSS 2017
HTML & CSS 2017
 
Css tutorial
Css tutorialCss tutorial
Css tutorial
 
Css introduction
Css introductionCss introduction
Css introduction
 
Css basics
Css basicsCss basics
Css basics
 
Artdm171 Week5 Css
Artdm171 Week5 CssArtdm171 Week5 Css
Artdm171 Week5 Css
 
css-presentation.ppt
css-presentation.pptcss-presentation.ppt
css-presentation.ppt
 
css-ppt.pdf
css-ppt.pdfcss-ppt.pdf
css-ppt.pdf
 
TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0
 
Web 101
Web 101Web 101
Web 101
 
CSS Part I
CSS Part ICSS Part I
CSS Part I
 
Css introduction
Css  introductionCss  introduction
Css introduction
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
Workshop 2 Slides.pptx
Workshop 2 Slides.pptxWorkshop 2 Slides.pptx
Workshop 2 Slides.pptx
 

Recently uploaded

CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
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
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
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
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 

Recently uploaded (20)

CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
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
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri 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
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 

Class 2: CSS Selectors, Classes & Ids

  • 1. Class 2 Css: seleCtors, Classes & ids Web Design , gR APH -327 1- 01 Instructor: Erika Tarte Rhode Island School of Design Wintersession 2011
  • 3. from web content to webpage In addition to content, webpages contain hidden information that help browsers interpret structure, meaning, style, interactions, etc. Most of the visible information takes place in the body of the HTML document, while most of the hidden formation happens in the head of the HTML document. Some information happens in external files, like CSS and JavaScript. We link to these files in the head of the HTML document.
  • 4. basic html webpage <html> <head> <title>Document Title</title> </head> <body> ... </body> </html>
  • 5. Css
  • 6. what’s css? CSS Stands for Cascading Style Sheet Purpose HTML tells us what to display CSS tells us how to display Format Simple text file Contains rules for displaying HTML
  • 7. types of style sheets Inline Styles defined within an individual tag with a lot of content starts to become inefficient Internal styles defined at the top of each individual page with a lot of pages, starts to become inefficient External styles defined once for your whole site all of your html pages link to the same file extremely efficient (and its what we’ll do in this class)
  • 8. why external? Central definition of visual style make one change, the entire site is updated can be reused on any number of pages Developers and designers can work independently Same content can be restyled for lots of different media web print mobile phone iPod/iPhone/iPad
  • 9. characteristics Cascading style rules are applied in order last definition takes precedence over the first Order of priority 1 browser default lowest priority 2 external styles 3 internal styles 4 inline styles highest priority
  • 10. linking a css file to your html file The only change in the HTML file is to add a line of code at the top: <link rel=”stylesheet” type=”text/css” href=”styles.css” /> Tells browser to include a style sheet called styles.css You can name the file anything you want (webstyles.css, printstyles.css, awesome.css) Include the <link> tag just before the </head> tag in your HTML.
  • 11. basic html webpage w/ link to css file <html> <head> <title>Document Title</title> <link rel=”stylesheet” type=”text/css” href=”styles.css” /> </head> <body> ... </body> </html>
  • 12. linking your first file demo 1 Create a text file and save it as styles.css 2 Add this line to your HTML, right before the </head> tag: <link rel=”stylesheet” type=”text/css” href=”styles.css” /> 3 Start writing CSS rules in your styles.css file
  • 14. be prepared... There are many style properties, don’t worry about memorizing them! Keep a reference open while coding (www.w3schools.com)
  • 15. css syntax: vocabulary selector = what you are defining curly brackets { } = begin & end of rules for selector property = set of display properties you can change value = what you are changing the property to semicolon ; = ends each rule
  • 16. css syntax selector { property: value; property: value; }
  • 17. css syntax selector { selec toR is the html element these rules will change property: value; property: value; }
  • 18. css syntax selector { property: value; PRoPeRt y is a display characteristic you are writing a rule for. Each selector can have multiple properties, and property: value; some selectors have very specif ic properties. }
  • 19. css syntax selector { property: value; VAlue is the display characteristic that you want to apply to the property property: value; }
  • 20. css syntax sandwich { cheese: cheddar; bread: rye; condiment: mustard; condiment-style: spicy-brown; }
  • 21. css syntax h1 { font-family: Helvetica; font-size: 36px; font-weight:bold; text-transform:uppercase; color:#000000; }
  • 23. html class & id attributes These 2 attributes give you more control over the elements while using CSS No inherent styles or properties Different elements can share the same class IDs are unique, and different elements can’t share them
  • 24. html class & id attributes <a href="http://google.com" class="button">Link</a> <a href="http://google.com" id="button1">Link</a>
  • 25. css class & id selectors .button { font-size: 12px; color: #ff0000; text-decoration: none; } #button1 { font-size: 12px; color: #ff0000; text-decoration: none; background-color: #ffff00; }
  • 26. html class & id attributes <a href="http://google.com" class="button">Link</a> <a href="http://google.com" class=”button” id="button1">Link</a>
  • 27. css class & id selectors .button { font-size: 12px; color: #ff0000; text-decoration: none; } #button1 { font-size: 12px; color: #ff0000; text-decoration: none; background-color: #ffff00; }
  • 28. css class & id selectors .button { font-size: 12px; color: #ff0000; text-decoration: none; } #button1 { font-size: 12px; color: #ff0000; text-decoration: none; background-color: #ffff00; }
  • 29. css class & id selectors .button { font-size: 12px; color: #ff0000; text-decoration: none; } #button1 { background-color: #ffff00; }
  • 30. Color
  • 31. color values rgb (red, green, blue) values 0 to 255 additive color black: 0,0,0 white: 255,255,255 hexadecimal or “hex" encoded value of rgb black: #000000 white: #FFFFFF
  • 34. css property: color h1 { color: rgb(255,255,255); color: #ffffff; }
  • 35. css property: background-color h1 { color: #ffffff; background-color: #000000; }
  • 37. fonts Browsers only display fonts installed on the user’s computer (with some recent exceptions) To define fonts, the font-family: css property is used Designers use font-stacking to create prioritized lists of fonts to display (A safety net, incase the first desired typeface is unavailable) Start with a very specific typeface, move to a generic classification
  • 38. css property: font-family h1 { color: #ffffff; background-color: #000000; font-family: Akkurat, Helvetica, sans-serif; }
  • 39. css property: font-size h1 { color: #ffffff; background-color: #000000; font-family: Akkurat, Helvetica, sans-serif; font-size: 72px; }
  • 40. css property: font-weight h1 { color: #ffffff; background-color: #000000; font-family: Akkurat, Helvetica, sans-serif; font-size: 72px; font-weight: normal; }
  • 41. css property: letter-spacing h1 { color: #ffffff; background-color: #000000; font-family: Akkurat, Helvetica, sans-serif; font-size: 72px; font-weight: normal; letter-spacing: 4px; }
  • 42. css property: text-transform h1 { color: #ffffff; background-color: #000000; font-family: Akkurat, Helvetica, sans-serif; font-size: 72px; font-weight: normal; letter-spacing: 4px; text-transform: uppercase; }