SlideShare ist ein Scribd-Unternehmen logo
1 von 15
CSS: PART TWO
Web Design Elective | The Scholars’ Academy
What you know
   so far
How to create a basic page in HTML
       and style it with CSS.
 How to apply styles to every single
      HTML file on a page.
  Some basic styling techniques.
Today



We’re going to look at classes and IDs.

We’ll also take a look at some basic CSS properties.
Tomorrow


First Marking Period Project Due.

We’ll go over the nuts and bolts in moment.

First, let’s cover what we need to cover.
Classes and IDs

Classes let you apply a certain style only where you want it.

For example:

  For the class, .yeehaw {color: red;}

  <h1 class=“yeehaw”>Hello!</h1> would be
  styled.

  <h1>Hello!</h1> would not be styled.
Classes in CSS
You can throw classes around as much as you want.

Also, pay attention to this:




.yeehaw {color: red;}
Disconnecting the Dots


The dot doesn’t appear in the HTML though.

<h1 class=“yeehaw”>Hello!</h1>

See, no dot.
IDs

Kind of like classes, but you only use an ID once. You don’t
throw it around all willy-nilly like a class.

  For the ID, #yeehaw {color: red;}

  <h1 id=“yeehaw”>Hello!</h1> would be styled.

  <h1>Hello!</h1> would not be styled.
IDs in CSS
Again, only once.

Also, pay attention to this:




#yeehaw {color: red;}
Why would I
ever use an ID?
      Web designers use IDs to
 differentiate different parts of their
                layout.


  For example, you may want your
 footer text to be smaller than your
body text—or maybe a different color.
So, about those boxes


Go back to that last slide. No seriously, do it.

I didn’t tell you how to define sections of your layout.

The trick? The <div> tag.
DIVs


By itself, the DIV tag does nothing.

But it can be styled.

The <div> tag defines a division or a section in an HTML
document.
How to Use a DIV
Wrap them around each section:

  <div id=”header”>…</div>



Then in your CSS:

  #header {background-color: blue;}

Or something else that suits your fancy.
Getting Fancy
Remember how you could do this?

  h1 {font-size: 200%;}

Well, you can get fancy with your DIVs.

  #header h1 {font-size: 200%;}

  #description h1 {font-size: 150%;}

The H1s in the header will be bigger than in the description.
Part Two of This


I’m going to make a video of me doing this hands-on.

I’ll post it to http://web.scholarsnyc.com/

Go watch it.

Weitere ähnliche Inhalte

Ähnlich wie Web Design, Lesson Plan: Classes and IDs

Basic CSS concepts by naveen kumar veligeti
Basic CSS concepts by naveen kumar veligetiBasic CSS concepts by naveen kumar veligeti
Basic CSS concepts by naveen kumar veligetiNaveen Kumar Veligeti
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
Css basics
Css basicsCss basics
Css basicsASIT
 
Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSSanjoy Kr. Paul
 
Customizing Your WordPress Theme Using Firebug and Basic CSS
Customizing Your WordPress Theme Using Firebug and Basic CSSCustomizing Your WordPress Theme Using Firebug and Basic CSS
Customizing Your WordPress Theme Using Firebug and Basic CSSLaura Hartwig
 
Completing Your Design with WordPress
Completing Your Design with WordPressCompleting Your Design with WordPress
Completing Your Design with WordPressChelsea Otakan
 
Internet tech &amp; web prog. p4,5
Internet tech &amp; web prog.  p4,5Internet tech &amp; web prog.  p4,5
Internet tech &amp; web prog. p4,5Taymoor Nazmy
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorialhstryk
 
CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2Shawn Calvert
 
Intermediate Web Design
Intermediate Web DesignIntermediate Web Design
Intermediate Web Designmlincol2
 

Ähnlich wie Web Design, Lesson Plan: Classes and IDs (20)

HTML News Packages Lesson
HTML News Packages LessonHTML News Packages Lesson
HTML News Packages Lesson
 
Basic CSS concepts by naveen kumar veligeti
Basic CSS concepts by naveen kumar veligetiBasic CSS concepts by naveen kumar veligeti
Basic CSS concepts by naveen kumar veligeti
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
 
David Weliver
David WeliverDavid Weliver
David Weliver
 
Css
CssCss
Css
 
Css basics
Css basicsCss basics
Css basics
 
Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSS
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Customizing Your WordPress Theme Using Firebug and Basic CSS
Customizing Your WordPress Theme Using Firebug and Basic CSSCustomizing Your WordPress Theme Using Firebug and Basic CSS
Customizing Your WordPress Theme Using Firebug and Basic CSS
 
Completing Your Design with WordPress
Completing Your Design with WordPressCompleting Your Design with WordPress
Completing Your Design with WordPress
 
Internet tech &amp; web prog. p4,5
Internet tech &amp; web prog.  p4,5Internet tech &amp; web prog.  p4,5
Internet tech &amp; web prog. p4,5
 
Lecture2
Lecture2Lecture2
Lecture2
 
Class
ClassClass
Class
 
Class
ClassClass
Class
 
Fewd week2 slides
Fewd week2 slidesFewd week2 slides
Fewd week2 slides
 
CSS Layout Tutorial
CSS Layout TutorialCSS Layout Tutorial
CSS Layout Tutorial
 
Sacramento web design
Sacramento web designSacramento web design
Sacramento web design
 
CSS Foundations, pt 2
CSS Foundations, pt 2CSS Foundations, pt 2
CSS Foundations, pt 2
 
Intermediate Web Design
Intermediate Web DesignIntermediate Web Design
Intermediate Web Design
 

Mehr von Steve Kinney

Vite, Workshop Slides (Frontend Masters)
Vite, Workshop Slides (Frontend Masters)Vite, Workshop Slides (Frontend Masters)
Vite, Workshop Slides (Frontend Masters)Steve Kinney
 
Building Real-Time Applications in Ember.js
Building Real-Time Applications in Ember.jsBuilding Real-Time Applications in Ember.js
Building Real-Time Applications in Ember.jsSteve Kinney
 
Ember and WebSockets
Ember and WebSocketsEmber and WebSockets
Ember and WebSocketsSteve Kinney
 
Web Design, Lesson 1
Web Design, Lesson 1Web Design, Lesson 1
Web Design, Lesson 1Steve Kinney
 
Writing A Hypothesis
Writing A HypothesisWriting A Hypothesis
Writing A HypothesisSteve Kinney
 
Writing A Research Question
Writing A Research QuestionWriting A Research Question
Writing A Research QuestionSteve Kinney
 

Mehr von Steve Kinney (6)

Vite, Workshop Slides (Frontend Masters)
Vite, Workshop Slides (Frontend Masters)Vite, Workshop Slides (Frontend Masters)
Vite, Workshop Slides (Frontend Masters)
 
Building Real-Time Applications in Ember.js
Building Real-Time Applications in Ember.jsBuilding Real-Time Applications in Ember.js
Building Real-Time Applications in Ember.js
 
Ember and WebSockets
Ember and WebSocketsEmber and WebSockets
Ember and WebSockets
 
Web Design, Lesson 1
Web Design, Lesson 1Web Design, Lesson 1
Web Design, Lesson 1
 
Writing A Hypothesis
Writing A HypothesisWriting A Hypothesis
Writing A Hypothesis
 
Writing A Research Question
Writing A Research QuestionWriting A Research Question
Writing A Research Question
 

Web Design, Lesson Plan: Classes and IDs

  • 1. CSS: PART TWO Web Design Elective | The Scholars’ Academy
  • 2. What you know so far How to create a basic page in HTML and style it with CSS. How to apply styles to every single HTML file on a page. Some basic styling techniques.
  • 3. Today We’re going to look at classes and IDs. We’ll also take a look at some basic CSS properties.
  • 4. Tomorrow First Marking Period Project Due. We’ll go over the nuts and bolts in moment. First, let’s cover what we need to cover.
  • 5. Classes and IDs Classes let you apply a certain style only where you want it. For example: For the class, .yeehaw {color: red;} <h1 class=“yeehaw”>Hello!</h1> would be styled. <h1>Hello!</h1> would not be styled.
  • 6. Classes in CSS You can throw classes around as much as you want. Also, pay attention to this: .yeehaw {color: red;}
  • 7. Disconnecting the Dots The dot doesn’t appear in the HTML though. <h1 class=“yeehaw”>Hello!</h1> See, no dot.
  • 8. IDs Kind of like classes, but you only use an ID once. You don’t throw it around all willy-nilly like a class. For the ID, #yeehaw {color: red;} <h1 id=“yeehaw”>Hello!</h1> would be styled. <h1>Hello!</h1> would not be styled.
  • 9. IDs in CSS Again, only once. Also, pay attention to this: #yeehaw {color: red;}
  • 10. Why would I ever use an ID? Web designers use IDs to differentiate different parts of their layout. For example, you may want your footer text to be smaller than your body text—or maybe a different color.
  • 11. So, about those boxes Go back to that last slide. No seriously, do it. I didn’t tell you how to define sections of your layout. The trick? The <div> tag.
  • 12. DIVs By itself, the DIV tag does nothing. But it can be styled. The <div> tag defines a division or a section in an HTML document.
  • 13. How to Use a DIV Wrap them around each section: <div id=”header”>…</div> Then in your CSS: #header {background-color: blue;} Or something else that suits your fancy.
  • 14. Getting Fancy Remember how you could do this? h1 {font-size: 200%;} Well, you can get fancy with your DIVs. #header h1 {font-size: 200%;} #description h1 {font-size: 150%;} The H1s in the header will be bigger than in the description.
  • 15. Part Two of This I’m going to make a video of me doing this hands-on. I’ll post it to http://web.scholarsnyc.com/ Go watch it.

Hinweis der Redaktion