SlideShare a Scribd company logo
Text in HTML5
HTML5 & CSS Visual QuickStart Guide
Chapter 4
The Importance of Text
• Unless your site is heavy on videos or photo galleries,
 most of your content will be text
  • Text to describes your company or yourself
  • Text to list product features
  • Information about something you want to share with your audience
• HTML5 tags for text are not designed to control how the
 content will look
  • That’s the job of CSS!
• HTML elements should describe the content
  • If something should be emphasized, use the <em> element
  • If you are citing another source, use the <cite> element
  • If the browser styles the content for you, that’s just a bonus
Starting a New Paragraph
• We’ve already established, HTML ignores extra returns or
  other white space
• To start a new paragraph, you use the <p> element
 • <p>Many tourists are drawn to Barcelona to see
   Antoni Gaudi’s incredible architecture.</p>
   <p>Barcelona celebrated the 150th anniversary of
   Gaudi’s birth in 2002.</p>
• To change how the paragraphs look, you can use styles
 to:
 • Change the font
 • Set a particular font size
 • Set the color
Adding Author Contact Information
• The <address> element defines contact info for author,
 people, or organization relevant to the HTML page
  • This usually appears at the end of the page
• You can have more than one <address> element in your
  page.
• Use it by enclosing the contact information in the opening
  and closing <address> tags
  • <address>
   Email her at <a href=“mailto:traceyw@thepaperofpapers.com”>
   traceyw@thepaperofpapers.com</a>
   </address>
• Most browsers will render the <address> element in italics
 by default
Creating a Figure
• Charts and graphs are commonly used in print
• Prior to HTML5, there was no element designed to
 present figures like charts and graphs
  • Developers often cobbled these together using <div> elements
• HTML5 presents the <figure> and <figcaption> elements
  • <figure> marks up the actual figure, such as a chart or a graph
  • <figcaption> is optional, and marks up the caption for your figure
• These elements are purely semantic; they won’t actually
 add text or figures on their own
  • Enclose images, data tables, videos, etc. within the <figure>
    element
Specifying Time
• You can mark up precise time or calendar date with the
  new <time> element
• Commonly used to indicate publication date of an
  <article> element
  • To do so, include pubdate attribute
• <p><time datetime=“2011-10-15”
  pubdate=“pubdate”>October 15, 2011</time>
  </p>
• The text inside the <time> element is optional, and
  appears on the screen as a human-readable version of
  the datetime value
The datetime Format
• The <time> element’s time is based on 24-hour clock
  • Optional time-zone offset from UTC (Coordinated Universal Time)
• The datetime attribute provides date and time in
 machine-readble format
  • YYYY-MM-DDThh:mm:ss
  • 2011-11-03T17:19:10
     • Means November 3, 2011 at 10 seconds after 5:19 p.m. local time
    • T separates the date and time
    • Seconds field is optional
Marking Important and Emphasized
Text
• <strong> element denotes important text
• <em> element shows emphasis
• Can be used separately or together
  • <em>under any circumstances</em>
  • <strong>under any circumstances</strong>
  • <p><strong>Warning: Do not approach the zombies
    <em>under any circumstances</em>.</strong> They
    may <em>look</em> friendly, but that’s just
    because they want to eat your brains.</p>
• Browsers usually display <strong> text as bold, and <em>
 text as italics.
Indicating a Citation or Reference
• If you need to cite or reference a source, use <cite> tag
   • <p>He listened to <cite>Abbey Road</cite> while
     watching <cite>A Hard Day’s Night</cite> and
     reading <cite>The Beatles Anthology</cite>
• The <cite> element renders in italics by default
• Don’t use the <cite> element for a reference to a person’s
 name! HTML5 explicitly declares this to be invalid
  • (but previous versions of HTML allowed it)
Quoting Text
• Two elements for marking text quoted from a source
  • <blockquote> represents a quote that stands alone
    • Renders on its own line by default
    • Will usually render indented, too
  • <q> element is for short quotes, like those within a sentence.
     • Renders in-line with the rest of the surrounding text
    • Browsers are supposed to add curly double quotes around <q>
      elements automatically, but not all browsers support this
Quoting Text (cont’d)
• <blockquote
 cite=“http://www.marktwainbooks.edu/the-
 adventures-of-huckleberry-finn/”
 <p>we said there warn’t no home like a
 raft, after all. Other places do seem so
 cramped up and smothery, but a raft don’t.
 You feel might free and easy and
 comfortable on a raft.</p>
 </blockquote>
 <p>And then she said, <q>Have you read
 Barbara Kingsolver’s <cite>High Tide in
 Tucson?</cite> It’s inspiring.</q></p>
Quoting Text (cont’d again)
• You can nest <blockquote> and <q> elements
  • The browser should automatically add a curly single quote around
    a nested <q> element, but some browsers aren’t compliant
• <p>The short story began, <q>When she was a child, she
  would say, <q>Howdy, stranger!</q> to everyone she
  passed.</q></p>
• Because of the cross-browser issues with <q>, many
  coders put in the quotation marks themselves. See
  http://html5doctor.com/blockquote-q-cite/ for more
  discussion on this
Highlighting Text
• Key words and phrases can be highlighted with the <mark>
 element
  • The semantic version of a highlighter pen
• Used to draw the reader’s attention to a particular segment of
 text. For example:
  • To highlight a search term when it appears in search results page or
    article
  • To call attention to part of a quote that wasn’t highlighted by the author
    in its original form
• Browsers with native support of <mark> element display a
 yellow background behind the text by default
  • You can tell older browsers to do this using CSS
• <p>Remove the tray from the box. Pierce the
 wrapper several times with a fork and cook on
 High for <mark>15 minutes</mark>, rotating it
 halfway through</p>
Explaining Abbreviations
• Use the <abbr> element to mark up abbreviations and
 explain their meaning
  • Only use this when you think it would be helpful for visitors to be
   given the expanded meaning!
• You can use the optional title attribute to provide the
  expanded version of an abbreviation
• Or, and some would say preferably, you could place the
  explanation in parentheses after the abbreviation.
Explaining Abbreviations (cont’d)
• <p>The <abbr title=“National Football
  League”>NFL</abbr> promised a laser show at
  9 p.m. after every night game.</p>
• Firefox and Opera will put a dotted underline beneath
  abbreviations with the title attribute.
 • All browsers (except IE6, which you should never, ever use) show
   the contents in a tooltip
Defining a Term
• <dfn> element marks the one place in document where
 you define a term
 • Do not wrap subsequent uses of the term
 • Wrap <dfn> only around the term you’re defining, not the definition
• <p>The contestant was asked to spell
  “pleonasm.” She requested the definition
  and was told that <dfn>pleonasm</dfn> means
  “a redundant word or expression.”</p>
• The <dfn> element renders italicized by some browsers
  (but not all of ‘em)
Creating Superscripts and
Subscripts
• Superscripts: letters or numbers that are raised slighly
 relative to the main body text
  • 2nd
• Subscripts: letters or numbers that are lowered slightly
 relative to the main body text
  • H2O

• Mark these using <sup> and <sub> elements
• These elements will screw up your line height, but this
 can be fixed using CSS
  • http://necolas.github.com/normalize.css/
  • https://gist.github.com/413930
Superscripts and Subscripts in Use
• <p>On February 2<sup>nd</sup>, we will find
  out whether or not spring will be along
  soon.</p>
• <p>The deadliest chemical, one which you
  cannot live without but can kill you in a
  matter of minutes, has the chemical formula
  H<sub>2</sub>O.</p>
Noting Edits and Inaccurate Text
• If you want to mark up edits since the previous version of
  your page, or mark up text no longer accurate or relevant,
  you can do so using the <ins> and <del> elements
• <ul>
       <li><del>2 desks</del></li>
       <li>1 chalkboard</li>
       <li><del>4 laptops</del></li>
       <li><ins>1 bicycle</ins></li>
  </ul>
More on Marking Inaccurate Text
• For text that is no longer accurate, you can use the <s>
  element
• <ol>
      <li><ins>2 p.m. (this show just
  added)</ins></li>
      <li><s>5 p.m.</s> SOLD OUT</li>
      <li><s>8:30 p.m.</s> SOLD OUT</li>
  </ol>
Marking Up Code
• If you provide code samples, file names, or program
  names in your content, you should mark them as code
• <code> element indicates text is code or a file name.
  • Is rendered as a monospaced font by default
• If you want to show a standalone block of code (outside of
  a sentence), wrap the <code> element with a <pre>
  element.
• <p>the <code>showPhoto()</code> function
  displays …</p>
Marking Up Code (cont’d)
• <pre>
     <code>
          abbr[ title] {
               border-bottom: 1px dotted
 #000;
          }
     </code>
 </pre>
Specifying Fine Print
• <small> element represents side comments, such as fine
 print
 • Might include disclaimers, caveats, legal restrictions, or copyrights
 • Also used for attribution or satisfying license requirements
 • Intended for brief portion of inline text
• <p>Order now to receive free shipping.
  <small>(Some restrictions may apply.)
  </small></p>
• <footer>
      <p><small>&copy; 2011 The Super Store.
  All
      Rights Reserved. </small></p>
  </footer>
Line Breaks and Spans
• Line Breaks
   • We already discussed this
    • <br /> element
• Spans
  • No semantic meaning
  • Used if you want to apply any of the following to a snippet of HTML
    for which HTML doesn’t provide an appropriate semantic element
    • Attributes, like class, dir, id, lang, title, etc
    • Styling with CSS
    • Behavior with JavaScript
  • Use this as a last resort!
  • <p>Gaudi’s work was essentially useful. <span
    lang=“es”>La Casa Mila</span> is an apartment
    building and <em>real people</em> live there.</p>
The <meter> Element
• New to HTML5
• Used to indicate a fractional value or a measurement
 within a known range
  • Voting results
  • Number of tickets sold
  • Numerical test grades
  • Disk usage
• Not widely supported yet
  • Only Chrome fully supports <meter>. Other browsers support it
    inconsistently, or not at all
  • Can by styled with CSS or enhanced with JavaScript to make it
    somewhat workable in non-supporting browsers
The <meter> Element (cont’d)
• <p>Project completion status: <meter
    value=“0.80”>80% completed</meter></p>
•   <p>Car brake pad wear: <meter low=“0.25”
    high=“0.75” optimum=“0” value=“0.21”>21%
    worn</meter></p>
•   <p>Miles walked during half-marathon:
    <meter min=“0” max=“13.1” value=“4.5”
    title=“Miles”>4.5</meter></p>
•   No defined units of measure, but can use title attribute
    to specify one
•   Attributes for value, min, low, high, max affect how
    meter gauge is displayed
The <progress> Element
• Used to show a progress bar
• Supported by Chrome, but not by many other browsers
  yet
• <p>Please wait while we save your data.
  Current progress: <progress max=“100”
  value=“0”>0% saved</progress></p>
• <p>Please wait while we save your data.
  Current progress: <progress max=“100”
  value=“67”>67% saved</progress></p>

More Related Content

What's hot

What's new in HTML5, CSS3 and JavaScript, James Pearce
What's new in HTML5, CSS3 and JavaScript, James PearceWhat's new in HTML5, CSS3 and JavaScript, James Pearce
What's new in HTML5, CSS3 and JavaScript, James Pearce
Sencha
 
Wordpress & HTML5 by Rob Larsen
Wordpress & HTML5 by Rob LarsenWordpress & HTML5 by Rob Larsen
Wordpress & HTML5 by Rob Larsen
George Mamadashvili
 
Abstracting functionality with centralised content
Abstracting functionality with centralised contentAbstracting functionality with centralised content
Abstracting functionality with centralised content
Michael Peacock
 
Findability Bliss Through Web Standards
Findability Bliss Through Web StandardsFindability Bliss Through Web Standards
Findability Bliss Through Web Standards
Aarron Walter
 
Arizona WP - Building a WordPress Theme
Arizona WP - Building a WordPress ThemeArizona WP - Building a WordPress Theme
Arizona WP - Building a WordPress Theme
certainstrings
 
Html intro
Html introHtml intro
Html intro
Robyn Overstreet
 
Introduction to html 5
Introduction to html 5Introduction to html 5
Introduction to html 5
Nir Elbaz
 
Perch CMS Summit: Perch Template Tips and Tricks
Perch CMS Summit: Perch Template Tips and TricksPerch CMS Summit: Perch Template Tips and Tricks
Perch CMS Summit: Perch Template Tips and Tricks
Rachel Andrew
 
Getting to know perch — and perch runway!
Getting to know perch — and perch runway!Getting to know perch — and perch runway!
Getting to know perch — and perch runway!
Abigail Larsen
 
Introduction to Google API - Focusky
Introduction to Google API - FocuskyIntroduction to Google API - Focusky
Introduction to Google API - Focusky
Focusky Presentation
 
ePUB 3 and Publishing e-books
ePUB 3 and Publishing e-booksePUB 3 and Publishing e-books
ePUB 3 and Publishing e-books
Kerem Karatal
 
WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3
David Bisset
 
Aloha talk about Performances
Aloha talk about PerformancesAloha talk about Performances
Aloha talk about Performances
bistory
 
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshell
Lennart Schoors
 
NewBCamp09: Turning your design into a WordPress Theme
NewBCamp09: Turning your design into a WordPress ThemeNewBCamp09: Turning your design into a WordPress Theme
NewBCamp09: Turning your design into a WordPress Theme
Adam Darowski
 
Xhtml 2010
Xhtml 2010Xhtml 2010
Xhtml 2010
guest0f1e7f
 
ACTC 2013 Website Building Notes
ACTC 2013 Website Building NotesACTC 2013 Website Building Notes
ACTC 2013 Website Building Notes
John Bentley, II
 
Html 5
Html 5Html 5
E Pi Server Easy Search Technical Overview
E Pi Server Easy Search Technical OverviewE Pi Server Easy Search Technical Overview
E Pi Server Easy Search Technical Overview
guestd9aa5
 

What's hot (19)

What's new in HTML5, CSS3 and JavaScript, James Pearce
What's new in HTML5, CSS3 and JavaScript, James PearceWhat's new in HTML5, CSS3 and JavaScript, James Pearce
What's new in HTML5, CSS3 and JavaScript, James Pearce
 
Wordpress & HTML5 by Rob Larsen
Wordpress & HTML5 by Rob LarsenWordpress & HTML5 by Rob Larsen
Wordpress & HTML5 by Rob Larsen
 
Abstracting functionality with centralised content
Abstracting functionality with centralised contentAbstracting functionality with centralised content
Abstracting functionality with centralised content
 
Findability Bliss Through Web Standards
Findability Bliss Through Web StandardsFindability Bliss Through Web Standards
Findability Bliss Through Web Standards
 
Arizona WP - Building a WordPress Theme
Arizona WP - Building a WordPress ThemeArizona WP - Building a WordPress Theme
Arizona WP - Building a WordPress Theme
 
Html intro
Html introHtml intro
Html intro
 
Introduction to html 5
Introduction to html 5Introduction to html 5
Introduction to html 5
 
Perch CMS Summit: Perch Template Tips and Tricks
Perch CMS Summit: Perch Template Tips and TricksPerch CMS Summit: Perch Template Tips and Tricks
Perch CMS Summit: Perch Template Tips and Tricks
 
Getting to know perch — and perch runway!
Getting to know perch — and perch runway!Getting to know perch — and perch runway!
Getting to know perch — and perch runway!
 
Introduction to Google API - Focusky
Introduction to Google API - FocuskyIntroduction to Google API - Focusky
Introduction to Google API - Focusky
 
ePUB 3 and Publishing e-books
ePUB 3 and Publishing e-booksePUB 3 and Publishing e-books
ePUB 3 and Publishing e-books
 
WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3WordPress Theme Workshop: Part 3
WordPress Theme Workshop: Part 3
 
Aloha talk about Performances
Aloha talk about PerformancesAloha talk about Performances
Aloha talk about Performances
 
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshell
 
NewBCamp09: Turning your design into a WordPress Theme
NewBCamp09: Turning your design into a WordPress ThemeNewBCamp09: Turning your design into a WordPress Theme
NewBCamp09: Turning your design into a WordPress Theme
 
Xhtml 2010
Xhtml 2010Xhtml 2010
Xhtml 2010
 
ACTC 2013 Website Building Notes
ACTC 2013 Website Building NotesACTC 2013 Website Building Notes
ACTC 2013 Website Building Notes
 
Html 5
Html 5Html 5
Html 5
 
E Pi Server Easy Search Technical Overview
E Pi Server Easy Search Technical OverviewE Pi Server Easy Search Technical Overview
E Pi Server Easy Search Technical Overview
 

Viewers also liked

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

Viewers also liked (8)

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

Similar to Castro Chapter 4

Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
Tadpole Collective
 
Html phrase tags
Html phrase tagsHtml phrase tags
Html phrase tags
eShikshak
 
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptxHTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
TEJASARGADE5
 
html
htmlhtml
html
tumetr1
 
Intro to html revised2
Intro to html revised2Intro to html revised2
Intro to html revised2
mmvidanes29
 
Semantic markup language
Semantic markup languageSemantic markup language
Semantic markup language
Partnered Health
 
Kick start @ html5
Kick start @ html5Kick start @ html5
Kick start @ html5
Umesh Agarwal
 
Web development basics
Web development basicsWeb development basics
Web development basics
Kalluri Vinay Reddy
 
BITM3730Week3.pptx
BITM3730Week3.pptxBITM3730Week3.pptx
BITM3730Week3.pptx
MattMarino13
 
HTML PPT.pdf
HTML PPT.pdfHTML PPT.pdf
HTML PPT.pdf
sunnyGupta325328
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
Abzetdin Adamov
 
web development.pdf
web development.pdfweb development.pdf
web development.pdf
BagHarki
 
Web development basics (Part-1)
Web development basics (Part-1)Web development basics (Part-1)
Web development basics (Part-1)
Rajat Pratap Singh
 
In Class Assignment 1 .docx
In Class Assignment 1                                        .docxIn Class Assignment 1                                        .docx
In Class Assignment 1 .docx
jaggernaoma
 
Artdm171 Week4 Tags
Artdm171 Week4 TagsArtdm171 Week4 Tags
Artdm171 Week4 Tags
Gilbert Guerrero
 
HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt
vaseemshaik21
 
2022 HTML5: The future is now
2022 HTML5: The future is now2022 HTML5: The future is now
2022 HTML5: The future is now
Gonzalo Cordero
 
Web Design.ppt
Web Design.pptWeb Design.ppt
Web Design.ppt
Dr.R.SUGANYA RENGARAJ
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
François Massart
 
Unit 2 (html)
Unit 2  (html)Unit 2  (html)
Unit 2 (html)
manochitra10
 

Similar to Castro Chapter 4 (20)

Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
 
Html phrase tags
Html phrase tagsHtml phrase tags
Html phrase tags
 
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptxHTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
HTML 5_cfbe4b8d-092saawww24bb33cb2358.pptx
 
html
htmlhtml
html
 
Intro to html revised2
Intro to html revised2Intro to html revised2
Intro to html revised2
 
Semantic markup language
Semantic markup languageSemantic markup language
Semantic markup language
 
Kick start @ html5
Kick start @ html5Kick start @ html5
Kick start @ html5
 
Web development basics
Web development basicsWeb development basics
Web development basics
 
BITM3730Week3.pptx
BITM3730Week3.pptxBITM3730Week3.pptx
BITM3730Week3.pptx
 
HTML PPT.pdf
HTML PPT.pdfHTML PPT.pdf
HTML PPT.pdf
 
Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
web development.pdf
web development.pdfweb development.pdf
web development.pdf
 
Web development basics (Part-1)
Web development basics (Part-1)Web development basics (Part-1)
Web development basics (Part-1)
 
In Class Assignment 1 .docx
In Class Assignment 1                                        .docxIn Class Assignment 1                                        .docx
In Class Assignment 1 .docx
 
Artdm171 Week4 Tags
Artdm171 Week4 TagsArtdm171 Week4 Tags
Artdm171 Week4 Tags
 
HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt
 
2022 HTML5: The future is now
2022 HTML5: The future is now2022 HTML5: The future is now
2022 HTML5: The future is now
 
Web Design.ppt
Web Design.pptWeb Design.ppt
Web Design.ppt
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
 
Unit 2 (html)
Unit 2  (html)Unit 2  (html)
Unit 2 (html)
 

More from Jeff Byrnes

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

More from 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
 

Recently uploaded

The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
sayalidalavi006
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 

Recently uploaded (20)

The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 

Castro Chapter 4

  • 1. Text in HTML5 HTML5 & CSS Visual QuickStart Guide Chapter 4
  • 2. The Importance of Text • Unless your site is heavy on videos or photo galleries, most of your content will be text • Text to describes your company or yourself • Text to list product features • Information about something you want to share with your audience • HTML5 tags for text are not designed to control how the content will look • That’s the job of CSS! • HTML elements should describe the content • If something should be emphasized, use the <em> element • If you are citing another source, use the <cite> element • If the browser styles the content for you, that’s just a bonus
  • 3. Starting a New Paragraph • We’ve already established, HTML ignores extra returns or other white space • To start a new paragraph, you use the <p> element • <p>Many tourists are drawn to Barcelona to see Antoni Gaudi’s incredible architecture.</p> <p>Barcelona celebrated the 150th anniversary of Gaudi’s birth in 2002.</p> • To change how the paragraphs look, you can use styles to: • Change the font • Set a particular font size • Set the color
  • 4. Adding Author Contact Information • The <address> element defines contact info for author, people, or organization relevant to the HTML page • This usually appears at the end of the page • You can have more than one <address> element in your page. • Use it by enclosing the contact information in the opening and closing <address> tags • <address> Email her at <a href=“mailto:traceyw@thepaperofpapers.com”> traceyw@thepaperofpapers.com</a> </address> • Most browsers will render the <address> element in italics by default
  • 5. Creating a Figure • Charts and graphs are commonly used in print • Prior to HTML5, there was no element designed to present figures like charts and graphs • Developers often cobbled these together using <div> elements • HTML5 presents the <figure> and <figcaption> elements • <figure> marks up the actual figure, such as a chart or a graph • <figcaption> is optional, and marks up the caption for your figure • These elements are purely semantic; they won’t actually add text or figures on their own • Enclose images, data tables, videos, etc. within the <figure> element
  • 6. Specifying Time • You can mark up precise time or calendar date with the new <time> element • Commonly used to indicate publication date of an <article> element • To do so, include pubdate attribute • <p><time datetime=“2011-10-15” pubdate=“pubdate”>October 15, 2011</time> </p> • The text inside the <time> element is optional, and appears on the screen as a human-readable version of the datetime value
  • 7. The datetime Format • The <time> element’s time is based on 24-hour clock • Optional time-zone offset from UTC (Coordinated Universal Time) • The datetime attribute provides date and time in machine-readble format • YYYY-MM-DDThh:mm:ss • 2011-11-03T17:19:10 • Means November 3, 2011 at 10 seconds after 5:19 p.m. local time • T separates the date and time • Seconds field is optional
  • 8. Marking Important and Emphasized Text • <strong> element denotes important text • <em> element shows emphasis • Can be used separately or together • <em>under any circumstances</em> • <strong>under any circumstances</strong> • <p><strong>Warning: Do not approach the zombies <em>under any circumstances</em>.</strong> They may <em>look</em> friendly, but that’s just because they want to eat your brains.</p> • Browsers usually display <strong> text as bold, and <em> text as italics.
  • 9. Indicating a Citation or Reference • If you need to cite or reference a source, use <cite> tag • <p>He listened to <cite>Abbey Road</cite> while watching <cite>A Hard Day’s Night</cite> and reading <cite>The Beatles Anthology</cite> • The <cite> element renders in italics by default • Don’t use the <cite> element for a reference to a person’s name! HTML5 explicitly declares this to be invalid • (but previous versions of HTML allowed it)
  • 10. Quoting Text • Two elements for marking text quoted from a source • <blockquote> represents a quote that stands alone • Renders on its own line by default • Will usually render indented, too • <q> element is for short quotes, like those within a sentence. • Renders in-line with the rest of the surrounding text • Browsers are supposed to add curly double quotes around <q> elements automatically, but not all browsers support this
  • 11. Quoting Text (cont’d) • <blockquote cite=“http://www.marktwainbooks.edu/the- adventures-of-huckleberry-finn/” <p>we said there warn’t no home like a raft, after all. Other places do seem so cramped up and smothery, but a raft don’t. You feel might free and easy and comfortable on a raft.</p> </blockquote> <p>And then she said, <q>Have you read Barbara Kingsolver’s <cite>High Tide in Tucson?</cite> It’s inspiring.</q></p>
  • 12. Quoting Text (cont’d again) • You can nest <blockquote> and <q> elements • The browser should automatically add a curly single quote around a nested <q> element, but some browsers aren’t compliant • <p>The short story began, <q>When she was a child, she would say, <q>Howdy, stranger!</q> to everyone she passed.</q></p> • Because of the cross-browser issues with <q>, many coders put in the quotation marks themselves. See http://html5doctor.com/blockquote-q-cite/ for more discussion on this
  • 13. Highlighting Text • Key words and phrases can be highlighted with the <mark> element • The semantic version of a highlighter pen • Used to draw the reader’s attention to a particular segment of text. For example: • To highlight a search term when it appears in search results page or article • To call attention to part of a quote that wasn’t highlighted by the author in its original form • Browsers with native support of <mark> element display a yellow background behind the text by default • You can tell older browsers to do this using CSS • <p>Remove the tray from the box. Pierce the wrapper several times with a fork and cook on High for <mark>15 minutes</mark>, rotating it halfway through</p>
  • 14. Explaining Abbreviations • Use the <abbr> element to mark up abbreviations and explain their meaning • Only use this when you think it would be helpful for visitors to be given the expanded meaning! • You can use the optional title attribute to provide the expanded version of an abbreviation • Or, and some would say preferably, you could place the explanation in parentheses after the abbreviation.
  • 15. Explaining Abbreviations (cont’d) • <p>The <abbr title=“National Football League”>NFL</abbr> promised a laser show at 9 p.m. after every night game.</p> • Firefox and Opera will put a dotted underline beneath abbreviations with the title attribute. • All browsers (except IE6, which you should never, ever use) show the contents in a tooltip
  • 16. Defining a Term • <dfn> element marks the one place in document where you define a term • Do not wrap subsequent uses of the term • Wrap <dfn> only around the term you’re defining, not the definition • <p>The contestant was asked to spell “pleonasm.” She requested the definition and was told that <dfn>pleonasm</dfn> means “a redundant word or expression.”</p> • The <dfn> element renders italicized by some browsers (but not all of ‘em)
  • 17. Creating Superscripts and Subscripts • Superscripts: letters or numbers that are raised slighly relative to the main body text • 2nd • Subscripts: letters or numbers that are lowered slightly relative to the main body text • H2O • Mark these using <sup> and <sub> elements • These elements will screw up your line height, but this can be fixed using CSS • http://necolas.github.com/normalize.css/ • https://gist.github.com/413930
  • 18. Superscripts and Subscripts in Use • <p>On February 2<sup>nd</sup>, we will find out whether or not spring will be along soon.</p> • <p>The deadliest chemical, one which you cannot live without but can kill you in a matter of minutes, has the chemical formula H<sub>2</sub>O.</p>
  • 19. Noting Edits and Inaccurate Text • If you want to mark up edits since the previous version of your page, or mark up text no longer accurate or relevant, you can do so using the <ins> and <del> elements • <ul> <li><del>2 desks</del></li> <li>1 chalkboard</li> <li><del>4 laptops</del></li> <li><ins>1 bicycle</ins></li> </ul>
  • 20. More on Marking Inaccurate Text • For text that is no longer accurate, you can use the <s> element • <ol> <li><ins>2 p.m. (this show just added)</ins></li> <li><s>5 p.m.</s> SOLD OUT</li> <li><s>8:30 p.m.</s> SOLD OUT</li> </ol>
  • 21. Marking Up Code • If you provide code samples, file names, or program names in your content, you should mark them as code • <code> element indicates text is code or a file name. • Is rendered as a monospaced font by default • If you want to show a standalone block of code (outside of a sentence), wrap the <code> element with a <pre> element. • <p>the <code>showPhoto()</code> function displays …</p>
  • 22. Marking Up Code (cont’d) • <pre> <code> abbr[ title] { border-bottom: 1px dotted #000; } </code> </pre>
  • 23. Specifying Fine Print • <small> element represents side comments, such as fine print • Might include disclaimers, caveats, legal restrictions, or copyrights • Also used for attribution or satisfying license requirements • Intended for brief portion of inline text • <p>Order now to receive free shipping. <small>(Some restrictions may apply.) </small></p> • <footer> <p><small>&copy; 2011 The Super Store. All Rights Reserved. </small></p> </footer>
  • 24. Line Breaks and Spans • Line Breaks • We already discussed this • <br /> element • Spans • No semantic meaning • Used if you want to apply any of the following to a snippet of HTML for which HTML doesn’t provide an appropriate semantic element • Attributes, like class, dir, id, lang, title, etc • Styling with CSS • Behavior with JavaScript • Use this as a last resort! • <p>Gaudi’s work was essentially useful. <span lang=“es”>La Casa Mila</span> is an apartment building and <em>real people</em> live there.</p>
  • 25. The <meter> Element • New to HTML5 • Used to indicate a fractional value or a measurement within a known range • Voting results • Number of tickets sold • Numerical test grades • Disk usage • Not widely supported yet • Only Chrome fully supports <meter>. Other browsers support it inconsistently, or not at all • Can by styled with CSS or enhanced with JavaScript to make it somewhat workable in non-supporting browsers
  • 26. The <meter> Element (cont’d) • <p>Project completion status: <meter value=“0.80”>80% completed</meter></p> • <p>Car brake pad wear: <meter low=“0.25” high=“0.75” optimum=“0” value=“0.21”>21% worn</meter></p> • <p>Miles walked during half-marathon: <meter min=“0” max=“13.1” value=“4.5” title=“Miles”>4.5</meter></p> • No defined units of measure, but can use title attribute to specify one • Attributes for value, min, low, high, max affect how meter gauge is displayed
  • 27. The <progress> Element • Used to show a progress bar • Supported by Chrome, but not by many other browsers yet • <p>Please wait while we save your data. Current progress: <progress max=“100” value=“0”>0% saved</progress></p> • <p>Please wait while we save your data. Current progress: <progress max=“100” value=“67”>67% saved</progress></p>