SlideShare une entreprise Scribd logo
1  sur  19
BASIC HTML
STRUCTURE
HTML5 & CSS Visual Quickstart Guide
Chapter 3
Starting Your Web Page
• First, a warning: do NOT copy and paste from this
 (or any other) PowerPoint!
 • Some characters will not copy correctly, and will break your HTML
 • Plus, it’s plagiarism :-P

• Begin with a DOCTYPE declaration
  • <!doctype html>
• To begin the HTML portion, type:
 • <html lang=“language-code”>
   • language-code is the language code that matches the default language
     of your page’s content. For instance, <html lang=“en”> for English or
     <html lang=“fr”> for French.
Creating the Foundation
• Web pages divided into two main sections
  • The head
   • Defines the title of the page
   • Provides information about your page to search engines, like Google
   • Adds style sheets
   • Defines scripts to be used in the page (such as in JavaScript
                           <head>
                           <title>Title</title>
                           </head>
   • The title is the only part visible to the audience
 • The body
    • After closing </head> tag, type <body>
    • Leave a few spaces for your content (your text and other parts of the
     body of your page
   • Close with </body>
Declaring the Encoding
• Encoding tells what character set to use
  • Yes, there is more than one!
  • Several versions of Unicode, Chinese, 3 or 4 Japanese
    codesets, Korean, Simplified Chinese, Traditional
    Chinese, Western Latin (several varieties), Western Roman, and
    various Mac- and Windows-specific flavors of Western
• If omitted, browser will use default character encoding
   • windows-1252 for English Windows
   • x-mac-roman for English Macintosh
• Specify in the head section:
  • <meta http-equiv=“content-type” content=“text/html; charset=utf-8” />
Creating a Title
• This is required in XHTML!
• Should be short and descriptive
• Usually, the Title will appear in the title bar and/or tab
• Title used by search indexes like Yahoo, Google, and
 Bing, as well as in your visitors’ browsers’ history lists and
 bookmarks
  • <title>My Web Page</title>
• No links, formatting, images, etc.; just text!
Creating Headings
• HTML provides for up to six levels of headers in your Web
  page, to divide your page into manageable chunks
• In the body, type <hn> where n is a number from 1 to 6
• Type the contents of the header
• Type </hn>, where n is the same number
  • <h1>Biography</h1>
  • <h4>Personal Life</h4>
Understanding HTML5’s Document
Outline
• Each HTML document has an underlying outline, like a
  table of contents
• HTML5 provides four sectioning content elements that
  mark distinct sections within a document
  • article
  • aside
  • nav
  • section
• Each sectioning element has its own h1-h6 heirarchy
  • So you can have more than one h1 in a page
• Look at these two examples:
   • http://www.csis.ysu.edu/~jlbutts/castroch3/outline1.html
   • http://www.csis.ysu.edu/~jlbutts/castroch3/outline2.html
Creating a Header
• The header element is good for a section of a page with
  introductory or navigational content
• Can have more than one header element! For
  example, one for the masthead and one for the navigation
  bar
• <header>
       <nav>
                <ul>
                        <li><a href=“#gaudi”>Barcelona’s Architect</a></li>
                        <li lang=“es”<a href=“#sagrada-familia”>La Sagrada
                                  Familia</a></li>
                        <li><a href=“#park-guell”>Park Guell</a></li>
                </ul>
       </nav>
 </header>
Creating an Article
• An article can be used to contain content like a newspaper
 article, but that’s not all!
  • In HTML5, “article” is more akin to “item”
• Definition of article, according to HTML5 spec:
  • The article element represents a self-contained composition in a
    document, page, application, or site and is, in principle, independently
    distributable or reusable, e.g., in syndication. This could be a forum
    post, a magazine or newspaper article, a blog entry, a user-submitted
    comment, an interactive widget or gadget, or any other independent
    item of content
• Now, on to creating it!
  • Use the <article> tag
  • Type the article’s contents
    (paragraphs, lists, audio, video, images, figures, etc.)
  • Close it with the </article> tag
Creating a Section
• Sections, usually, aren’t stand-alone the way articles are
• We used to use the <div> tag to break our content into
 chunks
  • Now, we can use the <section> tag instead, and be more
   semantically correct
• Often, your <article> will contain multiple <sections>, like
  the chapters in a book
• Don’t sweat the “right” or “wrong” of this distinction too
  much, but if your content is independent, use <article>
Specifying an Aside
• Sometimes, section of content is tangentially related to
  main content, but could stand on its own
• Indicate this with an aside
  • For example, an aside featuring information about Barcelona’s
   architectural wonders
• Indicate this with <aside></aside> tags (content of the
  aside goes inside the two tags
• It’s common to think of an aside as a sidebar, but you can
  place the element in a variety of places
  • A box within the main content
  • In the same column as the main content, but not nested inside it
  • In a secondary column like a sidebar
Creating a Footer
• Usually used like a page footer, but it can be used
    elsewhere
•   Represents a footer for the nearest article, aside, etc
•   When its nearest ancestor is the body, the footer is for the
    whole page
•   Excellent place for copyright notice!
•   Define it with <footer>content</footer>
Creating a generic container
• Sometimes, you have content that doesn’t really fit the
  section, article, aside, header, footer semantic layout
• Use <div> for these
• <div>content</div>
Starting a New Paragraph
• HTML does not recognize returns or other extra white
  space
• Use the <p> tag to start and end your paragraph
  • <p>Many tourists are drawn to Barcelona to see Antoni Gaudi’s
   incredible architecture.</p>
   <p>Barcelona celebrates the 150th anniversary of Gaudi’s birth in
   2002.</p>
Naming Elements
• Note: This becomes really important when you start
  formatting your page using CSS!
• To name a one-of-a-kind element: id=“name”
• To name groups of elements: class=“name”
• For example:
       <h1 id=“gaudi”>Antoni Gaudi</h1>
       <h2 class=“building”>La Casa Mila</h2>
       <h2 class=“building”>La Sagrada Familia</h2>
Creating Inline Spans
• Allows you to apply formatting to parts of your text, within
  the same paragraph or other chunk
• For example:
  • <p>Gaudi’s work was essentially useful. La Casa Milo is an
   apartment building and real people live there.</p>
    • If we’re applying formatting with CSS, and want “real people” to be
      formatted differently, we would use an inline span
  • <p>Gaudi’s work was essentially useful. La Casa Milo is an
   apartment building and <span class=“emph”>real people</span>
   live there.</p>
• No inherent formatting. It gets its formatting from applying
 styles to it, usually through its class or id.
Creating a Line Break
• If you want to create manual line breaks without using a
  new div or p element
• <br />
• Closing slash is only required in XHTML, but it’s good
  practice
• Use multiple br tags to create extra space between lines
  or paragraphs
Adding Comments
• Comments are important to remind yourself (or future
    editors) what you were trying to do
•   Comments only appear when document is opened with a
    text editor, or when source is viewed. Otherwise, they’re
    invisible.
•   <!-- This is a comment -->
•   View your commented page before publishing, to avoid
    sharing your (possibly) private comments with the public
•   Remember: anybody who views the page source can
    view the comments!
    • No passwords
    • No information you don’t want the public to have
Labeling Elements in a Web Page
• Can use the title attribute to add a tool tip label to parts of
  your Web page
• This is different from the <title> element!
• <div id=“toc” title=“Table of Contents”>
  • Everything within this div will display a tool tip with the text “Table of
   Contents” when the mouse is placed over it

Contenu connexe

Tendances

HTML Start Up - Introduction to HTML
HTML Start Up - Introduction to HTMLHTML Start Up - Introduction to HTML
HTML Start Up - Introduction to HTMLGrayzon Gonzales, LPT
 
Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quideJerry Wijaya
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Joseph Lewis
 
Content-Driven WordPress Development - WordCamp Omaha 2014
Content-Driven WordPress Development - WordCamp Omaha 2014Content-Driven WordPress Development - WordCamp Omaha 2014
Content-Driven WordPress Development - WordCamp Omaha 2014Stephanie Eckles
 
Web front end development introduction to html css and javascript
Web front end development introduction to html css and javascriptWeb front end development introduction to html css and javascript
Web front end development introduction to html css and javascriptMarc Huang
 
Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Thinkful
 
Code & Design your first website 4/18
Code & Design your first website 4/18Code & Design your first website 4/18
Code & Design your first website 4/18TJ Stalcup
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheetssmitha273566
 
GDI Seattle Intro to HTML and CSS - Class 1
GDI Seattle Intro to HTML and CSS - Class 1GDI Seattle Intro to HTML and CSS - Class 1
GDI Seattle Intro to HTML and CSS - Class 1Heather Rock
 

Tendances (18)

HTML Start Up - Introduction to HTML
HTML Start Up - Introduction to HTMLHTML Start Up - Introduction to HTML
HTML Start Up - Introduction to HTML
 
Week 6 Lecture
Week 6 LectureWeek 6 Lecture
Week 6 Lecture
 
Artistic Web Applications - Week3 - Part 1
Artistic Web Applications - Week3 - Part 1Artistic Web Applications - Week3 - Part 1
Artistic Web Applications - Week3 - Part 1
 
Html5 quick-learning-quide
Html5 quick-learning-quideHtml5 quick-learning-quide
Html5 quick-learning-quide
 
Week 4 Lecture Part 1
Week 4 Lecture Part 1Week 4 Lecture Part 1
Week 4 Lecture Part 1
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)
 
Artistic Web Applications - Week3 - Part 2
Artistic Web Applications - Week3 - Part 2Artistic Web Applications - Week3 - Part 2
Artistic Web Applications - Week3 - Part 2
 
Html.ppt
Html.pptHtml.ppt
Html.ppt
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Content-Driven WordPress Development - WordCamp Omaha 2014
Content-Driven WordPress Development - WordCamp Omaha 2014Content-Driven WordPress Development - WordCamp Omaha 2014
Content-Driven WordPress Development - WordCamp Omaha 2014
 
Web 101 intro to html
Web 101  intro to htmlWeb 101  intro to html
Web 101 intro to html
 
Web front end development introduction to html css and javascript
Web front end development introduction to html css and javascriptWeb front end development introduction to html css and javascript
Web front end development introduction to html css and javascript
 
Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)Code &amp; design your first website (3:16)
Code &amp; design your first website (3:16)
 
Code & Design your first website 4/18
Code & Design your first website 4/18Code & Design your first website 4/18
Code & Design your first website 4/18
 
Web development basics
Web development basicsWeb development basics
Web development basics
 
BASICS OF HTML
BASICS OF HTMLBASICS OF HTML
BASICS OF HTML
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
GDI Seattle Intro to HTML and CSS - Class 1
GDI Seattle Intro to HTML and CSS - Class 1GDI Seattle Intro to HTML and CSS - Class 1
GDI Seattle Intro to HTML and CSS - Class 1
 

En vedette

Castro Chapter 15
Castro Chapter 15Castro Chapter 15
Castro Chapter 15Jeff Byrnes
 
Financial analysis pp
Financial analysis ppFinancial analysis pp
Financial analysis ppJoeVelarde
 
Castro Chapter 6
Castro Chapter 6Castro Chapter 6
Castro Chapter 6Jeff Byrnes
 
INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2INFO3775 Chapter 2 Part 2
INFO3775 Chapter 2 Part 2Jeff Byrnes
 
Castro Chapter 7
Castro Chapter 7Castro Chapter 7
Castro Chapter 7Jeff Byrnes
 
Castro Chapter 5
Castro Chapter 5Castro Chapter 5
Castro Chapter 5Jeff Byrnes
 
Castro Chapter 4
Castro Chapter 4Castro Chapter 4
Castro Chapter 4Jeff 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
 

En vedette (8)

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

Similaire à Castro Chapter 3

Similaire à Castro Chapter 3 (20)

Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
What's a web page made of?
What's a web page made of?What's a web page made of?
What's a web page made of?
 
Html5.pptx
Html5.pptxHtml5.pptx
Html5.pptx
 
HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt
 
Structure
StructureStructure
Structure
 
HTML 5 Tutorial
HTML 5 TutorialHTML 5 Tutorial
HTML 5 Tutorial
 
xhtml_css.ppt
xhtml_css.pptxhtml_css.ppt
xhtml_css.ppt
 
Web forms and html (lect 1)
Web forms and html (lect 1)Web forms and html (lect 1)
Web forms and html (lect 1)
 
Lecture 2 - HTML Basics
Lecture 2 - HTML BasicsLecture 2 - HTML Basics
Lecture 2 - HTML Basics
 
Basics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointBasics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPoint
 
Html
HtmlHtml
Html
 
html css intro sanskar , saurabh.pptx
html css intro  sanskar , saurabh.pptxhtml css intro  sanskar , saurabh.pptx
html css intro sanskar , saurabh.pptx
 
BASIC HTML PROGRAMMING
BASIC HTML PROGRAMMINGBASIC HTML PROGRAMMING
BASIC HTML PROGRAMMING
 
Html5 semantics
Html5 semanticsHtml5 semantics
Html5 semantics
 
Khoa dang (kay)
Khoa dang (kay)Khoa dang (kay)
Khoa dang (kay)
 
Html5 p resentation by techmodi
Html5 p resentation by techmodiHtml5 p resentation by techmodi
Html5 p resentation by techmodi
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
 
Handout1 intro to html
Handout1 intro to htmlHandout1 intro to html
Handout1 intro to html
 
3. tutorial html web desain
3. tutorial html web desain3. tutorial html web desain
3. tutorial html web desain
 

Plus de 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
 

Plus de 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
 

Dernier

ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
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
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
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
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
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
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
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
 
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
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
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
 
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
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
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
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 

Dernier (20)

ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
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
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
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
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
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)
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
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
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.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
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
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
 
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
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 

Castro Chapter 3

  • 1. BASIC HTML STRUCTURE HTML5 & CSS Visual Quickstart Guide Chapter 3
  • 2. Starting Your Web Page • First, a warning: do NOT copy and paste from this (or any other) PowerPoint! • Some characters will not copy correctly, and will break your HTML • Plus, it’s plagiarism :-P • Begin with a DOCTYPE declaration • <!doctype html> • To begin the HTML portion, type: • <html lang=“language-code”> • language-code is the language code that matches the default language of your page’s content. For instance, <html lang=“en”> for English or <html lang=“fr”> for French.
  • 3. Creating the Foundation • Web pages divided into two main sections • The head • Defines the title of the page • Provides information about your page to search engines, like Google • Adds style sheets • Defines scripts to be used in the page (such as in JavaScript <head> <title>Title</title> </head> • The title is the only part visible to the audience • The body • After closing </head> tag, type <body> • Leave a few spaces for your content (your text and other parts of the body of your page • Close with </body>
  • 4. Declaring the Encoding • Encoding tells what character set to use • Yes, there is more than one! • Several versions of Unicode, Chinese, 3 or 4 Japanese codesets, Korean, Simplified Chinese, Traditional Chinese, Western Latin (several varieties), Western Roman, and various Mac- and Windows-specific flavors of Western • If omitted, browser will use default character encoding • windows-1252 for English Windows • x-mac-roman for English Macintosh • Specify in the head section: • <meta http-equiv=“content-type” content=“text/html; charset=utf-8” />
  • 5. Creating a Title • This is required in XHTML! • Should be short and descriptive • Usually, the Title will appear in the title bar and/or tab • Title used by search indexes like Yahoo, Google, and Bing, as well as in your visitors’ browsers’ history lists and bookmarks • <title>My Web Page</title> • No links, formatting, images, etc.; just text!
  • 6. Creating Headings • HTML provides for up to six levels of headers in your Web page, to divide your page into manageable chunks • In the body, type <hn> where n is a number from 1 to 6 • Type the contents of the header • Type </hn>, where n is the same number • <h1>Biography</h1> • <h4>Personal Life</h4>
  • 7. Understanding HTML5’s Document Outline • Each HTML document has an underlying outline, like a table of contents • HTML5 provides four sectioning content elements that mark distinct sections within a document • article • aside • nav • section • Each sectioning element has its own h1-h6 heirarchy • So you can have more than one h1 in a page • Look at these two examples: • http://www.csis.ysu.edu/~jlbutts/castroch3/outline1.html • http://www.csis.ysu.edu/~jlbutts/castroch3/outline2.html
  • 8. Creating a Header • The header element is good for a section of a page with introductory or navigational content • Can have more than one header element! For example, one for the masthead and one for the navigation bar • <header> <nav> <ul> <li><a href=“#gaudi”>Barcelona’s Architect</a></li> <li lang=“es”<a href=“#sagrada-familia”>La Sagrada Familia</a></li> <li><a href=“#park-guell”>Park Guell</a></li> </ul> </nav> </header>
  • 9. Creating an Article • An article can be used to contain content like a newspaper article, but that’s not all! • In HTML5, “article” is more akin to “item” • Definition of article, according to HTML5 spec: • The article element represents a self-contained composition in a document, page, application, or site and is, in principle, independently distributable or reusable, e.g., in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content • Now, on to creating it! • Use the <article> tag • Type the article’s contents (paragraphs, lists, audio, video, images, figures, etc.) • Close it with the </article> tag
  • 10. Creating a Section • Sections, usually, aren’t stand-alone the way articles are • We used to use the <div> tag to break our content into chunks • Now, we can use the <section> tag instead, and be more semantically correct • Often, your <article> will contain multiple <sections>, like the chapters in a book • Don’t sweat the “right” or “wrong” of this distinction too much, but if your content is independent, use <article>
  • 11. Specifying an Aside • Sometimes, section of content is tangentially related to main content, but could stand on its own • Indicate this with an aside • For example, an aside featuring information about Barcelona’s architectural wonders • Indicate this with <aside></aside> tags (content of the aside goes inside the two tags • It’s common to think of an aside as a sidebar, but you can place the element in a variety of places • A box within the main content • In the same column as the main content, but not nested inside it • In a secondary column like a sidebar
  • 12. Creating a Footer • Usually used like a page footer, but it can be used elsewhere • Represents a footer for the nearest article, aside, etc • When its nearest ancestor is the body, the footer is for the whole page • Excellent place for copyright notice! • Define it with <footer>content</footer>
  • 13. Creating a generic container • Sometimes, you have content that doesn’t really fit the section, article, aside, header, footer semantic layout • Use <div> for these • <div>content</div>
  • 14. Starting a New Paragraph • HTML does not recognize returns or other extra white space • Use the <p> tag to start and end your paragraph • <p>Many tourists are drawn to Barcelona to see Antoni Gaudi’s incredible architecture.</p> <p>Barcelona celebrates the 150th anniversary of Gaudi’s birth in 2002.</p>
  • 15. Naming Elements • Note: This becomes really important when you start formatting your page using CSS! • To name a one-of-a-kind element: id=“name” • To name groups of elements: class=“name” • For example: <h1 id=“gaudi”>Antoni Gaudi</h1> <h2 class=“building”>La Casa Mila</h2> <h2 class=“building”>La Sagrada Familia</h2>
  • 16. Creating Inline Spans • Allows you to apply formatting to parts of your text, within the same paragraph or other chunk • For example: • <p>Gaudi’s work was essentially useful. La Casa Milo is an apartment building and real people live there.</p> • If we’re applying formatting with CSS, and want “real people” to be formatted differently, we would use an inline span • <p>Gaudi’s work was essentially useful. La Casa Milo is an apartment building and <span class=“emph”>real people</span> live there.</p> • No inherent formatting. It gets its formatting from applying styles to it, usually through its class or id.
  • 17. Creating a Line Break • If you want to create manual line breaks without using a new div or p element • <br /> • Closing slash is only required in XHTML, but it’s good practice • Use multiple br tags to create extra space between lines or paragraphs
  • 18. Adding Comments • Comments are important to remind yourself (or future editors) what you were trying to do • Comments only appear when document is opened with a text editor, or when source is viewed. Otherwise, they’re invisible. • <!-- This is a comment --> • View your commented page before publishing, to avoid sharing your (possibly) private comments with the public • Remember: anybody who views the page source can view the comments! • No passwords • No information you don’t want the public to have
  • 19. Labeling Elements in a Web Page • Can use the title attribute to add a tool tip label to parts of your Web page • This is different from the <title> element! • <div id=“toc” title=“Table of Contents”> • Everything within this div will display a tool tip with the text “Table of Contents” when the mouse is placed over it