SlideShare ist ein Scribd-Unternehmen logo
1 von 16
JavaScript and CSS in
    HTML5 Web
    Development
   HTML5 Multimedia Developer’s Guide
             Chapter Two
              (Part Two)
Overview of CSS
Cascading Style Sheets (CSS) make Web
more manageable and design-friendly
Incorporated into Web page in 3 ways:
  From external CSS file
  From block of style instructions in
  <head>
  In-line as attribute of HTML tag
Why is it Cascading?
Priority of how 3 methods of CSS are used cascade
   Styling set on a tag overrides style found in
   head
   Styling found in head overrides style from
   external CSS file
   BUT: if CSS file is linked after styling in head,
   external file overrides styling found in head
So how does it work?
CSS works through system of selectors
  Selectors are identifiers that match page
  elements
Each selector has 1 or more declarations
  Declaration consists of a property and a
  value
An Example

p {border-style:solid;}
  Paragraph element (p) is selector
  border-style:solid is declaration
    Gives value solid to property
    border-style
Try this code:
<!doctype html>
<html lang=”en”>
   <head>
       <title>CSS Example 1</title>
   </head>
   <body>
       <p>I am text within a paragraph tag</p>
       I am another paragraph, but I do not sit in a
       paragraph tag. Therefore, I am not affected by
       CSS applied to paragraph tags.
       <p>I am another paragraph. My border is kinda
       neat, don’t ya think?</p>
   </body>
</html>
Now this...
<!doctype html>
<html lang=”en”>
     <head>
         <title>CSS Example 2</title>
         <style>
              p {border-style:solid;
                  padding:10px;
                  width:500px;}
         </style>
     </head>
     <body>
         <p>I am text within a paragraph tag</p>
         I am another paragraph, but I do not sit in a paragraph tag.
         Therefore, I am not affected by CSS applied to paragraph tags.
         <p>I am another paragraph. My border is kinda neat, don’t ya
         think?</p>
     </body>
</html>
Let’s look at cascading
<!doctype html>
<html lang=”en”>
     <head>
         <title>CSS Example 3</title>
         <link rel=”stylesheet” href=”style.css” type=”text/css” />
         <style>
              p {border-style:solid;padding:10px;width:500px;}
         </style>
     </head>
     <body>
         <p>I am text within a paragraph tag</p>
         I am another paragraph, but I do not sit in a paragraph tag.
         Therefore, I am not affected by CSS applied to paragraph tags.
         <p style=”font-style:normal;”>I am another paragraph. My border is
         kinda neat, don’t ya think?</p>
         <p style=”border-style:none;font-size:1em”>I am a paragraph, but
         (sigh) no border and small text</p>
     </body>
</html>
The style.css file

/*
This is a CSS external file
*/
p {
   font-size:2em;
   font-style:italic;
   }
ID Selectors
CSS can be applied to all visible HTML
tags
Can also target specific page areas using
identifiers
  Identifiers are set using the id attribute of
  the element. For example:
     <div id=”header”>
Playing With Identifiers



Type the code in Code Listings 2-7 and 2-8
CSS Classes vs. Identifiers

Identifiers apply CSS to one, unique page
element
Classes used to apply the same CSS to
multiple tags
Note: identifiers (in CSS) start with #.
Classes start with a period (.)
For Example...
.articletitle1 {font-
size:1.4em;}
.spacer1 (height:4px;}
Any page element with class of articletitle1
has a large font size
Any page element with class of spacer1 will
be 4px high
An Important Note


The # for identifiers and . for classes is used
only in CSS
When you set the id or class attribute, you
leave off the # or .
CSS and HTML5 Tags

How does CSS work with the new HTML5
tags?
  The same way!
  The new HTML5 tags are true HTML
  tags, so they’re treated the same as any
  other HTML tags.
Styling the Audio Tag
By default, the audio tag has little visual
impact
   Tag plays audio, and is aimed to and for
   the ears, not the eyes
Since it’s a native HTML5 tag, we can style
it
Code Listing 2-10

Weitere ähnliche Inhalte

Was ist angesagt? (19)

Css introduction
Css   introductionCss   introduction
Css introduction
 
Web programming css
Web programming cssWeb programming css
Web programming css
 
CSS - Cascading Style Sheet
CSS - Cascading Style SheetCSS - Cascading Style Sheet
CSS - Cascading Style Sheet
 
CSS- Cascading Style Sheet
CSS- Cascading Style SheetCSS- Cascading Style Sheet
CSS- Cascading Style Sheet
 
CSS introduction
CSS introductionCSS introduction
CSS introduction
 
CSS Introduction
CSS IntroductionCSS Introduction
CSS Introduction
 
HTML and CSS
HTML and CSSHTML and CSS
HTML and CSS
 
HTML- Hyper Text Markup Language
HTML- Hyper Text Markup LanguageHTML- Hyper Text Markup Language
HTML- Hyper Text Markup Language
 
Cascading Style Sheets
Cascading Style SheetsCascading Style Sheets
Cascading Style Sheets
 
Introduction to css & its attributes with syntax
Introduction to css & its attributes with syntaxIntroduction to css & its attributes with syntax
Introduction to css & its attributes with syntax
 
Casc Style Sheets Ii
Casc Style Sheets IiCasc Style Sheets Ii
Casc Style Sheets Ii
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
 
Web Design Assignment 1
Web Design Assignment 1 Web Design Assignment 1
Web Design Assignment 1
 
CSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and ColorCSS Basics - Stylesheets and Color
CSS Basics - Stylesheets and Color
 
CSS
CSSCSS
CSS
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
Week3 css
Week3 cssWeek3 css
Week3 css
 
Week 12 CSS - Review from last week
Week 12 CSS - Review from last weekWeek 12 CSS - Review from last week
Week 12 CSS - Review from last week
 

Andere mochten auch

Castro Chapter 7
Castro Chapter 7Castro Chapter 7
Castro Chapter 7Jeff Byrnes
 
Castro Chapter 3
Castro Chapter 3Castro Chapter 3
Castro Chapter 3Jeff Byrnes
 
Financial analysis pp
Financial analysis ppFinancial analysis pp
Financial analysis ppJoeVelarde
 
Castro Chapter 4
Castro Chapter 4Castro Chapter 4
Castro Chapter 4Jeff Byrnes
 
Castro Chapter 5
Castro Chapter 5Castro Chapter 5
Castro Chapter 5Jeff Byrnes
 
Castro Chapter 6
Castro Chapter 6Castro Chapter 6
Castro Chapter 6Jeff Byrnes
 
Castro Chapter 15
Castro Chapter 15Castro Chapter 15
Castro Chapter 15Jeff Byrnes
 
INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1Jeff Byrnes
 

Andere mochten auch (8)

Castro Chapter 7
Castro Chapter 7Castro Chapter 7
Castro Chapter 7
 
Castro Chapter 3
Castro Chapter 3Castro Chapter 3
Castro Chapter 3
 
Financial analysis pp
Financial analysis ppFinancial analysis pp
Financial analysis pp
 
Castro Chapter 4
Castro Chapter 4Castro Chapter 4
Castro Chapter 4
 
Castro Chapter 5
Castro Chapter 5Castro Chapter 5
Castro Chapter 5
 
Castro Chapter 6
Castro Chapter 6Castro Chapter 6
Castro Chapter 6
 
Castro Chapter 15
Castro Chapter 15Castro Chapter 15
Castro Chapter 15
 
INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1
 

Ähnlich wie INFO3775 Chapter 2 Part 2 (20)

Css
CssCss
Css
 
Unit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.pptUnit 2-CSS & Bootstrap.ppt
Unit 2-CSS & Bootstrap.ppt
 
Introduction to CSS in HTML.ppt
Introduction to CSS in HTML.pptIntroduction to CSS in HTML.ppt
Introduction to CSS in HTML.ppt
 
Html Styles-CSS
Html Styles-CSSHtml Styles-CSS
Html Styles-CSS
 
INTRODUCTIONS OF CSS
INTRODUCTIONS OF CSSINTRODUCTIONS OF CSS
INTRODUCTIONS OF CSS
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
 
IP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).pptIP - Lecture 6, 7 Chapter-3 (3).ppt
IP - Lecture 6, 7 Chapter-3 (3).ppt
 
DW_lesson2.ppt
DW_lesson2.pptDW_lesson2.ppt
DW_lesson2.ppt
 
DW_lesson2.ppt
DW_lesson2.pptDW_lesson2.ppt
DW_lesson2.ppt
 
DW_lesson2.ppt
DW_lesson2.pptDW_lesson2.ppt
DW_lesson2.ppt
 
DW_lesson2.ppt
DW_lesson2.pptDW_lesson2.ppt
DW_lesson2.ppt
 
DW_lesson2.ppt
DW_lesson2.pptDW_lesson2.ppt
DW_lesson2.ppt
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Lecture-6.pptx
Lecture-6.pptxLecture-6.pptx
Lecture-6.pptx
 
Css
CssCss
Css
 
Css
CssCss
Css
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
CSS.pdf
CSS.pdfCSS.pdf
CSS.pdf
 
Cascstylesheets
CascstylesheetsCascstylesheets
Cascstylesheets
 
html-css
html-csshtml-css
html-css
 

Mehr von Jeff Byrnes

Castro Chapter 11
Castro Chapter 11Castro Chapter 11
Castro Chapter 11Jeff Byrnes
 
Castro Chapter 10
Castro Chapter 10Castro Chapter 10
Castro Chapter 10Jeff Byrnes
 
Castro Chapter 9
Castro Chapter 9Castro Chapter 9
Castro Chapter 9Jeff Byrnes
 
Castro Chapter 8
Castro Chapter 8Castro Chapter 8
Castro Chapter 8Jeff Byrnes
 
Castro Chapter 2
Castro Chapter 2Castro Chapter 2
Castro Chapter 2Jeff Byrnes
 
Castro Chapter 2
Castro Chapter 2Castro Chapter 2
Castro Chapter 2Jeff Byrnes
 

Mehr von Jeff Byrnes (6)

Castro Chapter 11
Castro Chapter 11Castro Chapter 11
Castro Chapter 11
 
Castro Chapter 10
Castro Chapter 10Castro Chapter 10
Castro Chapter 10
 
Castro Chapter 9
Castro Chapter 9Castro Chapter 9
Castro Chapter 9
 
Castro Chapter 8
Castro Chapter 8Castro Chapter 8
Castro Chapter 8
 
Castro Chapter 2
Castro Chapter 2Castro Chapter 2
Castro Chapter 2
 
Castro Chapter 2
Castro Chapter 2Castro Chapter 2
Castro Chapter 2
 

Kürzlich hochgeladen

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 

Kürzlich hochgeladen (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 

INFO3775 Chapter 2 Part 2

  • 1. JavaScript and CSS in HTML5 Web Development HTML5 Multimedia Developer’s Guide Chapter Two (Part Two)
  • 2. Overview of CSS Cascading Style Sheets (CSS) make Web more manageable and design-friendly Incorporated into Web page in 3 ways: From external CSS file From block of style instructions in <head> In-line as attribute of HTML tag
  • 3. Why is it Cascading? Priority of how 3 methods of CSS are used cascade Styling set on a tag overrides style found in head Styling found in head overrides style from external CSS file BUT: if CSS file is linked after styling in head, external file overrides styling found in head
  • 4. So how does it work? CSS works through system of selectors Selectors are identifiers that match page elements Each selector has 1 or more declarations Declaration consists of a property and a value
  • 5. An Example p {border-style:solid;} Paragraph element (p) is selector border-style:solid is declaration Gives value solid to property border-style
  • 6. Try this code: <!doctype html> <html lang=”en”> <head> <title>CSS Example 1</title> </head> <body> <p>I am text within a paragraph tag</p> I am another paragraph, but I do not sit in a paragraph tag. Therefore, I am not affected by CSS applied to paragraph tags. <p>I am another paragraph. My border is kinda neat, don’t ya think?</p> </body> </html>
  • 7. Now this... <!doctype html> <html lang=”en”> <head> <title>CSS Example 2</title> <style> p {border-style:solid; padding:10px; width:500px;} </style> </head> <body> <p>I am text within a paragraph tag</p> I am another paragraph, but I do not sit in a paragraph tag. Therefore, I am not affected by CSS applied to paragraph tags. <p>I am another paragraph. My border is kinda neat, don’t ya think?</p> </body> </html>
  • 8. Let’s look at cascading <!doctype html> <html lang=”en”> <head> <title>CSS Example 3</title> <link rel=”stylesheet” href=”style.css” type=”text/css” /> <style> p {border-style:solid;padding:10px;width:500px;} </style> </head> <body> <p>I am text within a paragraph tag</p> I am another paragraph, but I do not sit in a paragraph tag. Therefore, I am not affected by CSS applied to paragraph tags. <p style=”font-style:normal;”>I am another paragraph. My border is kinda neat, don’t ya think?</p> <p style=”border-style:none;font-size:1em”>I am a paragraph, but (sigh) no border and small text</p> </body> </html>
  • 9. The style.css file /* This is a CSS external file */ p { font-size:2em; font-style:italic; }
  • 10. ID Selectors CSS can be applied to all visible HTML tags Can also target specific page areas using identifiers Identifiers are set using the id attribute of the element. For example: <div id=”header”>
  • 11. Playing With Identifiers Type the code in Code Listings 2-7 and 2-8
  • 12. CSS Classes vs. Identifiers Identifiers apply CSS to one, unique page element Classes used to apply the same CSS to multiple tags Note: identifiers (in CSS) start with #. Classes start with a period (.)
  • 13. For Example... .articletitle1 {font- size:1.4em;} .spacer1 (height:4px;} Any page element with class of articletitle1 has a large font size Any page element with class of spacer1 will be 4px high
  • 14. An Important Note The # for identifiers and . for classes is used only in CSS When you set the id or class attribute, you leave off the # or .
  • 15. CSS and HTML5 Tags How does CSS work with the new HTML5 tags? The same way! The new HTML5 tags are true HTML tags, so they’re treated the same as any other HTML tags.
  • 16. Styling the Audio Tag By default, the audio tag has little visual impact Tag plays audio, and is aimed to and for the ears, not the eyes Since it’s a native HTML5 tag, we can style it Code Listing 2-10