SlideShare a Scribd company logo
1 of 22
Download to read offline
(X)HTML: The Basics
What is (X)HTML?
What you need to know
• HTML
  •   Hypertext Markup Language
  •   A Computer language used to add objects and other information to a Web page
  •   Not a programming language, it’s a markup language

• Markup Language
  •   A set of markup tags

• HTML Tags
  •   Surrounded by angle brackets <>
      •   <html>
  •   Come in pairs
      •   <b>Content Here</b>
      •   Start Tag = first tag —also called an opening tag
      •   End Tag = second tag —also called a closing tag

• HTML Documents = Web Pages
  •   Describe Web pages
  •   Contain HTML tags and plain text
More stuff to know
• XHTML
 •   Extensible Hypertext Markup Language
 •   Very similar to HTML—same concept
 •   Newer and Stricter than HTML, but the two terms are often used interchangeably
 •   A sort of cross between HTML and XML (Extensible Markup Language)

• XML
 •   A set of rules used to encode electronic documents
 •   Employed to increase compatibility among electronic documents and satisfy current Web
     standards
 •   Employed to increase compatibility between electronic documents and the Web

• CSS
 •   Cascading Style Sheets
 •   A type of computer language used to specify how a web page should be presented
     •   Font colors, positioning, line spacing, borders, etc…
Two types of HTML and XHTML
• Strict
  •   The only one you should use
  •   Do not use outdated tags
  •   Everything in lowercase!

• Transitional
  •   Use only when dealing with a page that is in the process of being updated to the new
      version
HTML strict document type declaration
• DOCTYPE
• Document type declaration
• Always the first thing typed into your HTML document
• Appears BEFORE opening tag
• Tells the browser which version and what type of (X)HTML you are using
• Does not display as visual content on your Web page
• More forgiving than XHTML, so we will stick with what’s below
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
What’s the markup?
Anatomy of a tag
•   An (X)HTML tag is a name/keyword surrounded by angle brackets


•   The closing tag needs a slash   (/)   before the tag name

•   opening tag + closing tag + content = (X)HTML element —Below is an example of the h1 (X)HTML element



•   Use only   lowercase letters!
                                                                                            Closing tag


    Tag name
                       <h1>Content Here</h1>
    Opening tag


                                                                                    Angle Brackets
Most commonly used tags
•   <html>Content Here</html>                                       •   Italics

    •   Text placed between the angled brackets describes
        the Web page                                            •   <b>Content Here</b>
    •   Opening tag is very first displayed in the markup
                                                                    •   Bold


    •
        after DOCTYPE
        Closing tag is the very last displayed in the markup
                                                                •   <font>Content Here</font>
                                                                    •   Describes the font you’re using

•   <title>Content Here</title>
                                                                •   <q>Content Here</q>
    •   Text placed between the angled brackets describes
                                                                    •   Displays quotation marks around content
        the title of the Web page

•   <body>Content Here</body>                                   •   &nbsp;
    •   Text placed between the angled brackets describes           •   Adds a space
        the visible page content
                                                                •   <br />
•   <h1>Content Here</h1>                                           •   Adds a line break

    •   Text placed between the angled brackets displays as a       •   Empty/Self-Closing tag
        heading                                                     •   <br /> —space before the slash mark makes it
    •   h1 (largest heading), h2, h3, h4, h5, h6 (smallest              compatible with older browsers

                                                                •
        heading)
                                                                    <hr />
•   <p>Content Here</p>                                             •   Adds a horizontal line
    •
                                                                •
        Text placed between the angled brackets displays as a
        paragraph                                                   <img />
                                                                    •   Adds an image to your page
•   <i>Content Here</i>
Even more commonly used tags
•   <a>Content Here</a>
    •   Displays a hyperlink

•   <ol>Content Here</ol>
    •   Displays an ordered list
    •   Uses numbers for list items

•   <ul>Content Here</ul>
    •   Displays an unordered list
    •   Uses bullets for list items

•   <li>Content Here</li>
    •   Used in an unordered or ordered list to separate the
        items in a list
        <ol>
        <li>Coffee</li>
        <li>Tea</li>
        <li>Milk</li>
        </ol>

•   <center>Content Here</center>
    •   Centers content on a page
Yes, (X)HTML can be nested
• (X)HTML elements can be nested inside of each other
       <p><h1><i>Content Here</i></h1></p>

• When nesting elements, the first tag opened, must be the last tag closed
     •GOOD
       <p><h1><i>Content Here</i></h1></p>

     •BAD
       <p><h1></i>Content Here</p></h1></i>
Putting it to work

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<title>My Great Web Page</title>
<body>
<h1>My first heading</h1>
<h2>My second heading</h2>
<h3>My third heading</h3>
<h4>My fourth heading</h4>
<h5>My fifth heading</h5>
<h6>My sixth heading</h6>
&nbsp;
<h1><i>My italic heading</i></h1>
<h2><b>My bold heading</b></h2>
<p>This is a paragraph
with no line breaks.</p>
<p>
This<br />
is a<br />
paragraph<br />
with<br />
line breaks<br />
</p>
</body>
</html>
Wait, there’s more
Attributes
• Adds extra information to an (X)HTML tag
• The value for an attribute can be placed within either single or double quotes
• Always go inside the opening tag
• Tags can have multiple attributes
  •   Separate each attribute with a space



 Attribute


        <font face="verdana">Content Here</font>

                                                  Value
Commonly used attributes and values
•   face                                                      •   width
    •   Describes a typeface                                      •   Specifies the width of an image or horizontal line
    •   <font face="garamond">This is Garamond.</font>            •   Use pixels
                                                                      •    <img src="http://www.interestment.co.uk/wp-
•   color                                                                  content/uploads/2009/04/lampard-poodle.jpg"
                                                                           alt=Crazy Poodle width="100" />
    •   Describes a tag’s color
                                                                  •   Or use percentages
    •   <font color="#FFFF00">This is yellow text.</font>
                                                                      •    <img src="http://www.interestment.co.uk/wp-
    •   <hr color="#80ff80" />                                             content/uploads/2009/04/lampard-poodle.jpg"
                                                                           alt=Crazy Poodle width="50%" />
•   bgcolor                                                       •   If you don’t include the height attribute, the image will
    •   Describes a background color for your page                    be resized proportionately
    •   <body bgcolor="#FFFF00">Content Here</body>
                                                              •   height
•   src                                                           •   Specifies the height of an image
    •   Describes your image source                               •   Use pixels or percentages
    •   <img src="http://www.interestment.co.uk/wp-content/       •   <img src="http://www.interestment.co.uk/wp-content/
        uploads/2009/04/lampard-poodle.jpg" />                        uploads/2009/04/lampard-poodle.jpg" alt=Crazy
                                                                      Poodle width="50%" height="20%" />

•   alt                                                           •   If you don’t include the width attribute, the image will
                                                                      be resized proportionately
    •   Specifies an alternate text for an image
    •   <img src="http://www.interestment.co.uk/wp-content/
                                                              •   size
        uploads/2009/04/lampard-poodle.jpg" alt=Crazy
        Poodle />                                                 •   Specifies the height of a typeface [-8(–)+8]
                                                                  •   <font face="garamond" size="+5" height="60">This is
                                                                      Garamond.</font>
Hyperlink (Anchor) attributes and values

•   href                                                        •   target
    •   Describes your hyperlinked Web source                       •   Describes the browser window you want the
    •   <a href="http://www.google.com">Click here to go                hyperlink to open in
        to Google!</a>                                              •   _blank, _self, _parent, _top
                                                                    •   Opens hyperlink in a new browser window
•   name                                                                •   <a href="http://www.google.com"
    •   Describes a name anchor (bookmark)                                  target="_blank">Click here to go to Google!</
                                                                            a>
    •   Enables travel within a single html document
                                                                    •   Opens hyperlink in the current browser window
    •   First create your bookmarks
                                                                        •   <a href="http://www.google.com"
        •   <a name="P1">Paragraph One</a>                                  target="_self">Click here to go to Google!</a>
    •   Next, create your hyperlink that will take you to the
        bookmark of your choice
        •   <a href="#P1">Click to Return to Paragraph
            One</a>
Now what?
Using TextEdit

• TextEdit is the Plain Text Editor for Mac users
  •   Finder ➞ Applications ➞ TextEdit
  •   PC Users will use Notepad
  •   Google Search for other available plain text editors if
      necessary


• Once in TextEdit ➞ Format ➞ Make Plain Text
  •   File ➞ Save As ➞ index.html

  •      lowercase letters!
      Use only

  • No spaces !
  •   You must include the .html extension!
I need more tags!
     http://cedesign.net/help2j.htm
    http://www.w3schools.com/tags/
Web-Safe Fonts
http://www.ampsoft.net/webdesign-l/WindowsMacFonts.html
Web-Safe Colors
     http://ficml.org/jemimap/style/color/wheel.html
 http://www.webmonkey.com/reference/Color_Charts
More sources
        http://www.tizag.com/htmlT/
http://www.learningnerd.com/series/xhtml-css

More Related Content

What's hot

Intro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 SlidesIntro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 Slides
Heather Rock
 

What's hot (20)

Html
HtmlHtml
Html
 
HTML & CSS Masterclass
HTML & CSS MasterclassHTML & CSS Masterclass
HTML & CSS Masterclass
 
Week 2-intro-html
Week 2-intro-htmlWeek 2-intro-html
Week 2-intro-html
 
Web Development using HTML & CSS
Web Development using HTML & CSSWeb Development using HTML & CSS
Web Development using HTML & CSS
 
Intro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 SlidesIntro to HTML and CSS - Class 2 Slides
Intro to HTML and CSS - Class 2 Slides
 
HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS Basics
 
Introduction to WEB HTML, CSS
Introduction to WEB HTML, CSSIntroduction to WEB HTML, CSS
Introduction to WEB HTML, CSS
 
html-css
html-csshtml-css
html-css
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
 
HTML CSS | Computer Science
HTML CSS | Computer ScienceHTML CSS | Computer Science
HTML CSS | Computer Science
 
Css notes
Css notesCss notes
Css notes
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
PHP HTML CSS Notes
PHP HTML CSS  NotesPHP HTML CSS  Notes
PHP HTML CSS Notes
 
Html css java script basics All about you need
Html css java script basics All about you needHtml css java script basics All about you need
Html css java script basics All about you need
 
Presentation on html, css
Presentation on html, cssPresentation on html, css
Presentation on html, css
 
HTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts BasicsHTML, CSS and Java Scripts Basics
HTML, CSS and Java Scripts Basics
 
HTML Foundations, pt 2
HTML Foundations, pt 2HTML Foundations, pt 2
HTML Foundations, pt 2
 
Intro to HTML
Intro to HTMLIntro to HTML
Intro to HTML
 

Viewers also liked

Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
vikasgaur31
 
How to manage a big scale HTML/CSS project
How to manage a big scale HTML/CSS projectHow to manage a big scale HTML/CSS project
How to manage a big scale HTML/CSS project
Renoir Boulanger
 
process management
 process management process management
process management
Ashish Kumar
 

Viewers also liked (20)

Introduction to HTML
Introduction to HTMLIntroduction to HTML
Introduction to HTML
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
HTML presentation for beginners
HTML presentation for beginnersHTML presentation for beginners
HTML presentation for beginners
 
Hackers vs developers
Hackers vs developersHackers vs developers
Hackers vs developers
 
Black Hat 2014: Don’t be a Target: Everything You Know About Vulnerability Pr...
Black Hat 2014: Don’t be a Target: Everything You Know About Vulnerability Pr...Black Hat 2014: Don’t be a Target: Everything You Know About Vulnerability Pr...
Black Hat 2014: Don’t be a Target: Everything You Know About Vulnerability Pr...
 
How to manage a big scale HTML/CSS project
How to manage a big scale HTML/CSS projectHow to manage a big scale HTML/CSS project
How to manage a big scale HTML/CSS project
 
Magic in ruby
Magic in rubyMagic in ruby
Magic in ruby
 
Ruby objects
Ruby objectsRuby objects
Ruby objects
 
ZODB Tips and Tricks
ZODB Tips and TricksZODB Tips and Tricks
ZODB Tips and Tricks
 
Designing Ruby APIs
Designing Ruby APIsDesigning Ruby APIs
Designing Ruby APIs
 
MongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouchMongoDB - Ruby document store that doesn't rhyme with ouch
MongoDB - Ruby document store that doesn't rhyme with ouch
 
Ruby object model
Ruby object modelRuby object model
Ruby object model
 
The Black Magic of Ruby Metaprogramming
The Black Magic of Ruby MetaprogrammingThe Black Magic of Ruby Metaprogramming
The Black Magic of Ruby Metaprogramming
 
Tags in html
Tags in htmlTags in html
Tags in html
 
Web engineering lecture 1
Web engineering lecture 1Web engineering lecture 1
Web engineering lecture 1
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 
process management
 process management process management
process management
 
Accessibility & Compatibility
Accessibility & CompatibilityAccessibility & Compatibility
Accessibility & Compatibility
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 

Similar to HTML Lecture Part 1 of 2

Introduction to xhtml
Introduction to xhtmlIntroduction to xhtml
Introduction to xhtml
Dhairya Joshi
 
Castro Chapter 3
Castro Chapter 3Castro Chapter 3
Castro Chapter 3
Jeff Byrnes
 
Xhtml and html5 basics
Xhtml and html5 basicsXhtml and html5 basics
Xhtml and html5 basics
messinam
 
Introduction to XML, XHTML and CSS
Introduction to XML, XHTML and CSSIntroduction to XML, XHTML and CSS
Introduction to XML, XHTML and CSS
Jussi Pohjolainen
 

Similar to HTML Lecture Part 1 of 2 (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
 
Web forms and html (lect 1)
Web forms and html (lect 1)Web forms and html (lect 1)
Web forms and html (lect 1)
 
Html and css
Html and cssHtml and css
Html and css
 
Html intro
Html introHtml intro
Html intro
 
Introduction to xhtml
Introduction to xhtmlIntroduction to xhtml
Introduction to xhtml
 
Intro to HTML
Intro to HTMLIntro to HTML
Intro to HTML
 
Castro Chapter 3
Castro Chapter 3Castro Chapter 3
Castro Chapter 3
 
Html cia
Html ciaHtml cia
Html cia
 
CSS
CSSCSS
CSS
 
Khoa dang (kay)
Khoa dang (kay)Khoa dang (kay)
Khoa dang (kay)
 
Xhtml and html5 basics
Xhtml and html5 basicsXhtml and html5 basics
Xhtml and html5 basics
 
Intro to html, css & sass
Intro to html, css & sassIntro to html, css & sass
Intro to html, css & sass
 
Xhtml
XhtmlXhtml
Xhtml
 
Images and Lists in HTML
Images and Lists in HTMLImages and Lists in HTML
Images and Lists in HTML
 
HTML, CSS, JavaScript for beginners
HTML, CSS, JavaScript for beginnersHTML, CSS, JavaScript for beginners
HTML, CSS, JavaScript for beginners
 
HTML Coding
HTML CodingHTML Coding
HTML Coding
 
Introduction to XML, XHTML and CSS
Introduction to XML, XHTML and CSSIntroduction to XML, XHTML and CSS
Introduction to XML, XHTML and CSS
 
Html lesson1 5
Html lesson1 5Html lesson1 5
Html lesson1 5
 
html
htmlhtml
html
 

Recently uploaded

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
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
heathfieldcps1
 

Recently uploaded (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
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
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
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...
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
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
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 

HTML Lecture Part 1 of 2

  • 3. What you need to know • HTML • Hypertext Markup Language • A Computer language used to add objects and other information to a Web page • Not a programming language, it’s a markup language • Markup Language • A set of markup tags • HTML Tags • Surrounded by angle brackets <> • <html> • Come in pairs • <b>Content Here</b> • Start Tag = first tag —also called an opening tag • End Tag = second tag —also called a closing tag • HTML Documents = Web Pages • Describe Web pages • Contain HTML tags and plain text
  • 4. More stuff to know • XHTML • Extensible Hypertext Markup Language • Very similar to HTML—same concept • Newer and Stricter than HTML, but the two terms are often used interchangeably • A sort of cross between HTML and XML (Extensible Markup Language) • XML • A set of rules used to encode electronic documents • Employed to increase compatibility among electronic documents and satisfy current Web standards • Employed to increase compatibility between electronic documents and the Web • CSS • Cascading Style Sheets • A type of computer language used to specify how a web page should be presented • Font colors, positioning, line spacing, borders, etc…
  • 5. Two types of HTML and XHTML • Strict • The only one you should use • Do not use outdated tags • Everything in lowercase! • Transitional • Use only when dealing with a page that is in the process of being updated to the new version
  • 6. HTML strict document type declaration • DOCTYPE • Document type declaration • Always the first thing typed into your HTML document • Appears BEFORE opening tag • Tells the browser which version and what type of (X)HTML you are using • Does not display as visual content on your Web page • More forgiving than XHTML, so we will stick with what’s below <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  • 8. Anatomy of a tag • An (X)HTML tag is a name/keyword surrounded by angle brackets • The closing tag needs a slash (/) before the tag name • opening tag + closing tag + content = (X)HTML element —Below is an example of the h1 (X)HTML element • Use only lowercase letters! Closing tag Tag name <h1>Content Here</h1> Opening tag Angle Brackets
  • 9. Most commonly used tags • <html>Content Here</html> • Italics • Text placed between the angled brackets describes the Web page • <b>Content Here</b> • Opening tag is very first displayed in the markup • Bold • after DOCTYPE Closing tag is the very last displayed in the markup • <font>Content Here</font> • Describes the font you’re using • <title>Content Here</title> • <q>Content Here</q> • Text placed between the angled brackets describes • Displays quotation marks around content the title of the Web page • <body>Content Here</body> • &nbsp; • Text placed between the angled brackets describes • Adds a space the visible page content • <br /> • <h1>Content Here</h1> • Adds a line break • Text placed between the angled brackets displays as a • Empty/Self-Closing tag heading • <br /> —space before the slash mark makes it • h1 (largest heading), h2, h3, h4, h5, h6 (smallest compatible with older browsers • heading) <hr /> • <p>Content Here</p> • Adds a horizontal line • • Text placed between the angled brackets displays as a paragraph <img /> • Adds an image to your page • <i>Content Here</i>
  • 10. Even more commonly used tags • <a>Content Here</a> • Displays a hyperlink • <ol>Content Here</ol> • Displays an ordered list • Uses numbers for list items • <ul>Content Here</ul> • Displays an unordered list • Uses bullets for list items • <li>Content Here</li> • Used in an unordered or ordered list to separate the items in a list <ol> <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ol> • <center>Content Here</center> • Centers content on a page
  • 11. Yes, (X)HTML can be nested • (X)HTML elements can be nested inside of each other <p><h1><i>Content Here</i></h1></p> • When nesting elements, the first tag opened, must be the last tag closed •GOOD <p><h1><i>Content Here</i></h1></p> •BAD <p><h1></i>Content Here</p></h1></i>
  • 12. Putting it to work <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <title>My Great Web Page</title> <body> <h1>My first heading</h1> <h2>My second heading</h2> <h3>My third heading</h3> <h4>My fourth heading</h4> <h5>My fifth heading</h5> <h6>My sixth heading</h6> &nbsp; <h1><i>My italic heading</i></h1> <h2><b>My bold heading</b></h2> <p>This is a paragraph with no line breaks.</p> <p> This<br /> is a<br /> paragraph<br /> with<br /> line breaks<br /> </p> </body> </html>
  • 14. Attributes • Adds extra information to an (X)HTML tag • The value for an attribute can be placed within either single or double quotes • Always go inside the opening tag • Tags can have multiple attributes • Separate each attribute with a space Attribute <font face="verdana">Content Here</font> Value
  • 15. Commonly used attributes and values • face • width • Describes a typeface • Specifies the width of an image or horizontal line • <font face="garamond">This is Garamond.</font> • Use pixels • <img src="http://www.interestment.co.uk/wp- • color content/uploads/2009/04/lampard-poodle.jpg" alt=Crazy Poodle width="100" /> • Describes a tag’s color • Or use percentages • <font color="#FFFF00">This is yellow text.</font> • <img src="http://www.interestment.co.uk/wp- • <hr color="#80ff80" /> content/uploads/2009/04/lampard-poodle.jpg" alt=Crazy Poodle width="50%" /> • bgcolor • If you don’t include the height attribute, the image will • Describes a background color for your page be resized proportionately • <body bgcolor="#FFFF00">Content Here</body> • height • src • Specifies the height of an image • Describes your image source • Use pixels or percentages • <img src="http://www.interestment.co.uk/wp-content/ • <img src="http://www.interestment.co.uk/wp-content/ uploads/2009/04/lampard-poodle.jpg" /> uploads/2009/04/lampard-poodle.jpg" alt=Crazy Poodle width="50%" height="20%" /> • alt • If you don’t include the width attribute, the image will be resized proportionately • Specifies an alternate text for an image • <img src="http://www.interestment.co.uk/wp-content/ • size uploads/2009/04/lampard-poodle.jpg" alt=Crazy Poodle /> • Specifies the height of a typeface [-8(–)+8] • <font face="garamond" size="+5" height="60">This is Garamond.</font>
  • 16. Hyperlink (Anchor) attributes and values • href • target • Describes your hyperlinked Web source • Describes the browser window you want the • <a href="http://www.google.com">Click here to go hyperlink to open in to Google!</a> • _blank, _self, _parent, _top • Opens hyperlink in a new browser window • name • <a href="http://www.google.com" • Describes a name anchor (bookmark) target="_blank">Click here to go to Google!</ a> • Enables travel within a single html document • Opens hyperlink in the current browser window • First create your bookmarks • <a href="http://www.google.com" • <a name="P1">Paragraph One</a> target="_self">Click here to go to Google!</a> • Next, create your hyperlink that will take you to the bookmark of your choice • <a href="#P1">Click to Return to Paragraph One</a>
  • 18. Using TextEdit • TextEdit is the Plain Text Editor for Mac users • Finder ➞ Applications ➞ TextEdit • PC Users will use Notepad • Google Search for other available plain text editors if necessary • Once in TextEdit ➞ Format ➞ Make Plain Text • File ➞ Save As ➞ index.html • lowercase letters! Use only • No spaces ! • You must include the .html extension!
  • 19. I need more tags! http://cedesign.net/help2j.htm http://www.w3schools.com/tags/
  • 21. Web-Safe Colors http://ficml.org/jemimap/style/color/wheel.html http://www.webmonkey.com/reference/Color_Charts
  • 22. More sources http://www.tizag.com/htmlT/ http://www.learningnerd.com/series/xhtml-css