0% found this document useful (0 votes)
3 views74 pages

HTML5 Part1

This document is a comprehensive HTML tutorial from W3Schools, covering the basics of HTML, including its structure, elements, and usage. It provides examples, an online editor for practice, and references for further learning. Additionally, it offers quizzes and certification options for those looking to validate their HTML skills.

Uploaded by

lahadiademu7
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views74 pages

HTML5 Part1

This document is a comprehensive HTML tutorial from W3Schools, covering the basics of HTML, including its structure, elements, and usage. It provides examples, an online editor for practice, and references for further learning. Additionally, it offers quizzes and certification options for those looking to validate their HTML skills.

Uploaded by

lahadiademu7
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

9/2/2015 HTML Tutorial

Print Page

HTML(5) Tutorial
« W3Schools Home (/[Link]) Next Chapter » (html_intro.asp)

With HTML you can create your own Web site.


This tutorial teaches you everything about HTML.

HTML is easy to learn ­ You will enjoy it.

Examples in Every Chapter


This HTML tutorial contains hundreds of HTML examples.

With our online HTML editor, you can edit the HTML, and click on a button to view the result.

Example
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

Try it Yourself » ([Link]?filename=tryhtml_default)

Click on the "Try it Yourself" button to see how it works.

Start learning HTML now! (html_intro.asp)

HTML Examples
At the end of the HTML tutorial, you can find more than 200 examples.

[Link] 1/3
9/2/2015 HTML Tutorial

With our online editor, you can edit and test each example yourself.

Go to HTML Examples! (html_examples.asp)

HTML Quiz Test


Test your HTML skills at W3Schools!

Start HTML Quiz! (html_quiz.asp)

HTML References
At W3Schools you will find complete references about tags, attributes, events, color names, entities,
character­sets, URL encoding, language codes, HTTP messages, and more.

HTML Tag Reference (/tags/[Link])

HTML Exam ­ Get Your Diploma!


(/cert/[Link])

W3Schools' Online
Certification
The perfect solution for professionals who need to balance
work, family, and career building.

More than 10 000 certificates already issued!

Get Your Certificate » (/cert/[Link])

The HTML Certificate (/cert/[Link]) documents your knowledge of HTML.

The HTML5 Certificate (/cert/[Link]) documents your knowledge of advanced HTML5.

The CSS Certificate (/cert/[Link]) documents your knowledge of advanced CSS.

The JavaScript Certificate (/cert/[Link]) documents your knowledge of JavaScript and HTML
DOM.

The jQuery Certificate (/cert/[Link]) documents your knowledge of jQuery.

The PHP Certificate (/cert/[Link]) documents your knowledge of PHP and SQL (MySQL).

The XML Certificate (/cert/[Link]) documents your knowledge of XML, XML DOM and XSLT.

« W3Schools Home (/[Link]) Next Chapter » (html_intro.asp)


[Link] 2/3
9/2/2015 HTML Tutorial

Copyright 1999­2015 (/about/about_copyright.asp) by Refsnes Data. All Rights Reserved.

[Link] 3/3
9/2/2015 Introduction to HTML

Print Page

HTML Introduction
« Previous ([Link]) Next Chapter » (html_editors.asp)

What is HTML?
HTML is a markup language for describing web documents (web pages).

HTML stands for Hyper Text Markup Language


A markup language is a set of markup tags
HTML documents are described by HTML tags
Each HTML tag describes different document content

HTML Example
A small HTML document:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>My First Heading</h1>


<p>My first paragraph.</p>

</body>
</html>

Try it Yourself » ([Link]?filename=tryhtml_intro)

Example Explained
The DOCTYPE declaration defines the document type to be HTML
The text between <html> and </html> describes an HTML document
The text between <head> and </head> provides information about the document
The text between <title> and </title> provides a title for the document
The text between <body> and </body> describes the visible page content
The text between <h1> and </h1> describes a heading
The text between <p> and </p> describes a paragraph

[Link] 1/4
9/2/2015 Introduction to HTML

Using this description, a web browser can display a document with a heading and a paragraph.

HTML Tags
HTML tags are keywords (tag names) surrounded by angle brackets:

<tagname>content</tagname>

HTML tags normally come in pairs like <p> and </p>


The first tag in a pair is the start tag, the second tag is the end tag
The end tag is written like the start tag, but with a slash before the tag name

The start tag is often called the opening tag. The end tag is often called the closing
tag.

Web Browsers
The purpose of a web browser (Chrome, IE, Firefox, Safari) is to read HTML documents and display
them.

The browser does not display the HTML tags, but uses them to determine how to display the
document:

HTML Page Structure


Below is a visualization of an HTML page structure:

[Link] 2/4
9/2/2015 Introduction to HTML

<html>

<head>

<title>Page title</title>

</head>

<body>

<h1>This is a heading</h1>

<p>This is a paragraph.</p>

<p>This is another paragraph.</p>

</body>

</html>

Only the <body> area (the white area) is displayed by the browser.

The <!DOCTYPE> Declaration


The <!DOCTYPE> declaration helps the browser to display a web page correctly.

There are different document types on the web.

To display a document correctly, the browser must know both type and version.

The doctype declaration is not case sensitive. All cases are acceptable:

<!DOCTYPE html>

<!DOCTYPE HTML>

<!doctype html>

<!Doctype Html>

Common Declarations

[Link] 3/4
9/2/2015 Introduction to HTML

HTML5
<!DOCTYPE html>

HTML 4.01
<!DOCTYPE HTML PUBLIC "‐//W3C//DTD HTML 4.01 Transitional//EN"
"[Link]

XHTML 1.0
<!DOCTYPE html PUBLIC "‐//W3C//DTD XHTML 1.0 Transitional//EN"
"[Link]

All tutorials and examples at W3Schools use HTML5.

HTML Versions
Since the early days of the web, there have been many versions of HTML:

Version Year

HTML 1991

HTML 2.0 1995

HTML 3.2 1997

HTML 4.01 1999

XHTML 2000

HTML5 2014

« Previous ([Link]) Next Chapter » (html_editors.asp)

Copyright 1999­2015 (/about/about_copyright.asp) by Refsnes Data. All Rights Reserved.

[Link] 4/4
9/2/2015 HTML Editors

Print Page

HTML Editors
« Previous (html_intro.asp) Next Chapter » (html_basic.asp)

Write HTML Using Notepad or TextEdit


HTML can be edited by using professional HTML editors like:

Microsoft WebMatrix
Sublime Text

However, for learning HTML we recommend a text editor like Notepad (PC) or TextEdit (Mac).

We believe using a simple text editor is a good way to learn HTML.

Follow the 4 steps below to create your first web page with Notepad.

Step 1: Open Notepad


To open Notepad in Windows 7 or earlier:

Click Start (bottom left on your screen). Click All Programs. Click Accessories. Click Notepad.

To open Notepad in Windows 8 or later:

Open the Start Screen (the window symbol at the bottom left on your screen). Type Notepad.

Step 2: Write Some HTML


Write or copy some HTML into Notepad.

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>

[Link] 1/3
9/2/2015 HTML Editors

Step 3: Save the HTML Page


Save the file on your computer.

Select File > Save as in the Notepad menu.

Name the file "[Link]" or any other name ending with html or htm.

UTF­8 is the preferred encoding for HTML files.

ANSI encoding covers US and Western European characters only.

You can use either .htm or .html as file extension. There is no difference, it is up to
you.

Step 4: View HTML Page in Your Browser


Open the saved HTML file in your favorite browser. The result will look much like this:

[Link] 2/3
9/2/2015 HTML Editors

To open a file in a browser, double click on the file, or right­click, and choose open
with.

« Previous (html_intro.asp) Next Chapter » (html_basic.asp)

Copyright 1999­2015 (/about/about_copyright.asp) by Refsnes Data. All Rights Reserved.

[Link] 3/3
9/2/2015 HTML Basic

Print Page

HTML Basic Examples


« Previous (html_editors.asp) Next Chapter » (html_elements.asp)

Don't worry if these examples use tags you have not learned.

You will learn about them in the next chapters.

HTML Documents
All HTML documents must start with a type declaration: <!DOCTYPE html>.

The HTML document itself begins with <html> and ends with </html>.

The visible part of the HTML document is between <body> and </body>.

Example
<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>

Try it Yourself » ([Link]?filename=tryhtml_basic_document)

HTML Headings
HTML headings are defined with the <h1> to <h6> tags:

Example
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>

Try it Yourself » ([Link]?filename=tryhtml_basic_headings)

[Link] 1/3
9/2/2015 HTML Basic

HTML Paragraphs
HTML paragraphs are defined with the <p> tag:

Example
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

Try it Yourself » ([Link]?filename=tryhtml_basic_paragraphs)

HTML Links
HTML links are defined with the <a> tag:

Example
<a href="[Link] is a link</a>

Try it Yourself » ([Link]?filename=tryhtml_basic_link)

The link's destination is specified in the href attribute.

Attributes are used to provide additional information about HTML elements.

HTML Images
HTML images are defined with the <img> tag.

The source file (src), alternative text (alt), and size (width and height) are provided as attributes:

Example
<img src="[Link]" alt="[Link]" width="104" height="142">

Try it Yourself » ([Link]?filename=tryhtml_basic_img)

You will learn more about attributes in a later chapter.

[Link] 2/3
9/2/2015 HTML Basic

« Previous (html_editors.asp) Next Chapter » (html_elements.asp)

Copyright 1999­2015 (/about/about_copyright.asp) by Refsnes Data. All Rights Reserved.

[Link] 3/3
9/2/2015 HTML Elements

Print Page

HTML Elements
« Previous (html_basic.asp) Next Chapter » (html_attributes.asp)

HTML documents are made up by HTML elements.

HTML Elements
HTML elements are written with a start tag, with an end tag, with the content in between:

<tagname>content</tagname>

The HTML element is everything from the start tag to the end tag:

<p>My first HTML paragraph.</p>

Start tag Element content End tag

<h1> My First Heading </h1>

<p> My first paragraph. </p>

<br>

Some HTML elements do not have an end tag.

Nested HTML Elements


HTML elements can be nested (elements can contain elements).

All HTML documents consist of nested HTML elements.

This example contains 4 HTML elements:

Example
<!DOCTYPE html>
<html>
<body>

[Link] 1/4
9/2/2015 HTML Elements

<h1>My First Heading</h1>


<p>My first paragraph.</p>

</body>
</html>

Try it yourself » ([Link]?filename=tryhtml_elements)

HTML Example Explained


The <html> element defines the whole document.

It has a start tag <html> and an end tag </html>.

The element content is another HTML element (the <body> element).

<html>
<body>

<h1>My First Heading</h1>


<p>My first paragraph.</p>

</body>
</html>

The <body> element defines the document body.

It has a start tag <body> and an end tag </body>.

The element content is two other HTML elements (<h1> and <p>).

<body>

<h1>My First Heading</h1>


<p>My first paragraph.</p>

</body>

The <h1> element defines a heading.

It has a start tag <h1> and an end tag </h1>.

The element content is: My First Heading.

<h1>My First Heading</h1>

The <p> element defines a paragraph.

It has a start tag <p> and an end tag </p>.

[Link] 2/4
9/2/2015 HTML Elements

The element content is: My first paragraph.

<p>My first paragraph.</p>

Don't Forget the End Tag


Some HTML elements will display correctly, even if you forget the end tag:

Example
<html>
<body>

<p>This is a paragraph
<p>This is a paragraph

</body>
</html>

Try it yourself » ([Link]?filename=tryhtml_no_endtag)

The example above works in all browsers, because the closing tag is considered optional.

Never rely on this. It might produce unexpected results and/or errors if you forget the end tag.

Empty HTML Elements


HTML elements with no content are called empty elements.

<br> is an empty element without a closing tag (the <br> tag defines a line break).

Empty elements can be "closed" in the opening tag like this: <br />.

HTML5 does not require empty elements to be closed. But if you want stricter validation, or you need
to make your document readable by XML parsers, you should close all HTML elements.

HTML Tip: Use Lowercase Tags


HTML tags are not case sensitive: <P> means the same as <p>.

The HTML5 standard does not require lowercase tags, but W3C recommends lowercase in HTML4,
and demands lowercase for stricter document types like XHTML.

At W3Schools we always use lowercase tags.

[Link] 3/4
9/2/2015 HTML Elements

« Previous (html_basic.asp) Next Chapter » (html_attributes.asp)

Copyright 1999­2015 (/about/about_copyright.asp) by Refsnes Data. All Rights Reserved.

[Link] 4/4
9/2/2015 HTML Attributes

Print Page

HTML Attributes
« Previous (html_elements.asp) Next Chapter » (html_headings.asp)

Attributes provide additional information about HTML elements.

HTML Attributes
HTML elements can have attributes
Attributes provide additional information about an element
Attributes are always specified in the start tag
Attributes come in name/value pairs like: name="value"

The lang Attribute


The document language can be declared in the <html> tag.

The language is declared in the lang attribute.

Declaring a language is important for accessibility applications (screen readers) and search engines:

<!DOCTYPE html>
<html lang="en‐US">
<body>

<h1>My First Heading</h1>


<p>My first paragraph.</p>

</body>
</html>

The first two letters specify the language (en). If there is a dialect, use two more letters (US).

The title Attribute


HTML paragraphs are defined with the <p> tag.

In this example, the <p> element has a title attribute. The value of the attribute is "About
W3Schools":

Example
[Link] 1/5
9/2/2015 HTML Attributes

<p title="About W3Schools">


W3Schools is a web developer's site.
It provides tutorials and references covering
many aspects of web programming,
including HTML, CSS, JavaScript, XML, SQL, PHP, ASP, etc.
</p>

Try it Yourself » ([Link]?filename=tryhtml_attributes_title)

When you move the mouse over the element, the title will be displayed as a tooltip.

The href Attribute


HTML links are defined with the <a> tag. The link address is specified in the href attribute:

Example
<a href="[Link] is a link</a>

Try it Yourself » ([Link]?filename=tryhtml_attributes_link)

You will learn more about links and the <a> tag later in this tutorial.

Size Attributes
HTML images are defined with the <img> tag.

The filename of the source (src), and the size of the image (width and height) are all provided as
attributes:

Example
<img src="[Link]" width="104" height="142">

Try it Yourself » ([Link]?filename=tryhtml_attributes_img)

The image size is specified in pixels: width="104" means 104 screen pixels wide.

You will learn more about images and the <img> tag later in this tutorial.

The alt Attribute


[Link] 2/5
9/2/2015 HTML Attributes

The alt attribute specifies an alternative text to be used, when an HTML element cannot be
displayed.

The value of the attribute can be read by "screen readers". This way, someone "listening" to the
webpage, i.e. a blind person, can "hear" the element.

Example
<img src="[Link]" alt="[Link]" width="104" height="142">

Try it Yourself » ([Link]?filename=tryhtml_attributes_alt)

We Suggest: Always Use Lowercase Attributes


The HTML5 standard does not require lower case attribute names.

The title attribute can be written with upper or lower case like Title and/or TITLE.

W3C recommends lowercase in HTML4, and demands lowercase for stricter document types like
XHTML.

Lower case is the most common. Lower case is easier to type.


At W3Schools we always use lower case attribute names.

We Suggest: Always Quote Attribute Values


The HTML5 standard does not require quotes around attribute values.

The href attribute, demonstrated above, can be written as:

Example
<a href=[Link]

Try it Yourself » ([Link]?filename=tryhtml_attributes_noquotes)

W3C recommends quotes in HTML4, and demands quotes for stricter document types like XHTML.

Sometimes it is necessary to use quotes. This will not display correctly, because it contains a space:

Example
<p title=About W3Schools>

Try it Yourself » ([Link]?filename=tryhtml_attributes_error)


[Link] 3/5
9/2/2015 HTML Attributes

Using quotes are the most common. Omitting quotes can produce errors.
At W3Schools we always use quotes around attribute values.

Single or Double Quotes?


Double style quotes are the most common in HTML, but single style can also be used.

In some situations, when the attribute value itself contains double quotes, it is necessary to use single
quotes:

<p title='John "ShotGun" Nelson'>

Or vice versa:

<p title="John 'ShotGun' Nelson">

Chapter Summary
All HTML elements can have attributes
The HTML title attribute provides additional "tool­tip" information
The HTML href attribute provides address information for links
The HTML width and height attributes provide size information for images
The HTML alt attribute provides text for screen readers
At W3Schools we always use lowercase HTML attribute names
At W3Schools we always quote attributes with double quotes

Test Yourself with Exercises!


Exercise 1 » ([Link]?filename=exercise_attributes1)

Exercise 2 » ([Link]?filename=exercise_attributes2)

Exercise 3 » ([Link]?filename=exercise_attributes3)

Exercise 4 » ([Link]?filename=exercise_attributes4)

Exercise 5 » ([Link]?filename=exercise_attributes5)

[Link] 4/5
9/2/2015 HTML Attributes

HTML Attributes
Below is an alphabetical list of some attributes often used in HTML:

Attribute Description

alt Specifies an alternative text for an image

disabled Specifies that an input element should be disabled

href Specifies the URL (web address) for a link

id Specifies a unique id for an element

src Specifies the URL (web address) for an image

style Specifies an inline CSS style for an element

title Specifies extra information about an element (displayed as a tool tip)

value Specifies the value (text content) for an input element.

A complete list of all attributes for each HTML element, is listed in our: HTML Tag Reference
(/tags/[Link]).

« Previous (html_elements.asp) Next Chapter » (html_headings.asp)

Copyright 1999­2015 (/about/about_copyright.asp) by Refsnes Data. All Rights Reserved.

[Link] 5/5
9/2/2015 Exercise v1.3

Exercise:
Add a tooltip to the paragraph below with the text "About W3Schools".

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html> W3Schools is a web developer's site.
<body>

<p>W3Schools is a web developer's site.


</p>

</body>
</html>

Exercise ­ © [Link]
[Link] 1/1
9/2/2015 Exercise v1.3

Exercise:
Change the size of the image to 250 pixels wide and 400 pixels tall.

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html>
<body>

<img src="[Link]" width="104"


height="142">

</body>
</html>

Exercise ­ © [Link]
[Link] 1/1
9/2/2015 Exercise v1.3

Exercise:
Transform the text below into a link that goes to "[Link]".

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html> This is a link


<html>
<body>

This is a link

</body>
</html>

Exercise ­ © [Link]
[Link] 1/1
9/2/2015 Exercise v1.3

Exercise:
Change the destination of the link below to "[Link]".

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html> This is a link


<html>
<body>

<a href="[Link] is
a link</a>

</body>
</html>

Exercise ­ © [Link]
[Link] 1/1
9/2/2015 Exercise v1.3

Exercise:
The image below is unavailable on purpose. Specify an alternate text of "[Link]" to
be used,
so it can be read by "screen readers".

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html>
<body>

<img src="[Link]" width="135"


height="50">

</body>
</html>

Exercise ­ © [Link]
[Link] 1/1
9/2/2015 HTML Headings

Print Page

HTML Headings
« Previous (html_attributes.asp) Next Chapter » (html_paragraphs.asp)

Headings are important in HTML documents.

HTML Headings
Headings are defined with the <h1> to <h6> tags.

<h1> defines the most important heading. <h6> defines the least important heading.

Example
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>

Try it Yourself » ([Link]?filename=tryhtml_headings)

Note: Browsers automatically add some empty space (a margin) before and after each heading.

Headings Are Important


Use HTML headings for headings only. Don't use headings to make text BIG or bold.

Search engines use your headings to index the structure and content of your web pages.

Users skim your pages by its headings. It is important to use headings to show the document
structure.

h1 headings should be main headings, followed by h2 headings, then the less important h3, and so
on.

HTML Horizontal Rules


The <hr> tag creates a horizontal line in an HTML page.

The hr element can be used to separate content:

Example
[Link] 1/4
9/2/2015 HTML Headings

<p>This is a paragraph.</p>
<hr>
<p>This is a paragraph.</p>
<hr>
<p>This is a paragraph.</p>

Try it Yourself » ([Link]?filename=tryhtml_headings_hr)

The HTML <head> Element


The HTML <head> element has nothing to do with HTML headings.

The HTML <head> element contains meta data. Meta data are not displayed.

The HTML <head> element is placed between the <html> tag and the <body> tag:

Example
<!DOCTYPE html>
<html>

<head>
<title>My First HTML</title>
<meta charset="UTF‐8">
</head>

<body>
.
.
.

Try it Yourself » ([Link]?filename=tryhtml_headings_head)

Meta data means data about data. HTML meta data is data about the HTML
document.

The HTML <title> Element


The HTML <title> element is meta data. It defines the HTML document's title.

The title will not be displayed in the document, but might be displayed in the browser tab.

The HTML <meta> Element


The HTML <meta> element is also meta data.

[Link] 2/4
9/2/2015 HTML Headings

It can be used to define the character set, and other information about the HTML document.

More Meta Elements


In the chapter about HTML styles you discover more meta elements:

The HTML <style> element is used to define internal CSS style sheets.

The HTML <link> element is used to define external CSS style sheets.

HTML Tip ­ How to View HTML Source


Have you ever seen a Web page and wondered "Hey! How did they do that?"

To find out, right­click in the page and select "View Page Source" (in Chrome) or "View Source" (in
IE), or similar in another browser. This will open a window containing the HTML code of the page.

Test Yourself with Exercises!


Exercise 1 » ([Link]?filename=exercise_headings1)

Exercise 2 » ([Link]?filename=exercise_headings2)

Exercise 3 » ([Link]?filename=exercise_headings3)

Exercise 4 » ([Link]?filename=exercise_headings4)

HTML Tag Reference


W3Schools' tag reference contains additional information about these tags and their attributes.

You will learn more about HTML tags and attributes in the next chapters of this tutorial.

Tag Description

<html> (/tags/tag_html.asp) Defines an HTML document

<body> (/tags/tag_body.asp) Defines the document's body

<head> (/tags/tag_head.asp) Defines the document's head element

<h1> to <h6> (/tags/tag_hn.asp) Defines HTML headings

<hr> (/tags/tag_hr.asp) Defines a horizontal line

[Link] 3/4
9/2/2015 HTML Headings

« Previous (html_attributes.asp) Next Chapter » (html_paragraphs.asp)

Copyright 1999­2015 (/about/about_copyright.asp) by Refsnes Data. All Rights Reserved.

[Link] 4/4
9/2/2015 Exercise v1.3

Exercise:
Add a horizontal rule between the heading and the paragraph.

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html>
<body> London
<h1>London</h1>
London is the capital city of England. It is the
<p>London is the capital city of England. most populous city in the United Kingdom, with
It is the most populous city in the United a metropolitan area of over 13 million
Kingdom, with a metropolitan area of over inhabitants.
13 million inhabitants.</p>

</body>
</html>

Exercise ­ © [Link]
[Link] 1/1
9/2/2015 Exercise v1.3

Exercise:
Add six headings to the document with the text "Hello".

Start with the most important heading and end with the least important heading.

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html>
<body>

</body>
</html>

Exercise ­ © [Link]
[Link] 1/1
9/2/2015 Exercise v1.3

Exercise:
Mark up the following text with appropriate tags:
"Universal Studios" is the most important content.
"Jurassic Park" is the next most important content.
"About" is of lesser importance than Jurassic Park.
The last sentence is just a paragraph.

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html> Universal Studios Presents Jurassic Park About


<html>
On the Island of Isla Nublar, a new park has been
<body>
built: Jurassic Park is a theme park of cloned
Universal Studios Presents
dinosaurs!!

Jurassic Park

About

On the Island of Isla Nublar, a new park


has been built: Jurassic Park is a theme
park of cloned dinosaurs!!

</body>
</html>

Exercise ­ © [Link]
[Link] 1/1
9/2/2015 HTML Paragraphs

Print Page

HTML Paragraphs
« Previous (html_headings.asp) Next Chapter » (html_styles.asp)

HTML documents are divided into paragraphs.

HTML Paragraphs
The HTML <p> element defines a paragraph.

Example
<p>This is a paragraph</p>
<p>This is another paragraph</p>

Try it Yourself » ([Link]?filename=tryhtml_paragraphs1)

Browsers automatically add an empty line before and after a paragraph.

HTML Display
You cannot be sure how HTML will be displayed.

Large or small screens, and resized windows will create different results.

With HTML, you cannot change the output by adding extra spaces or extra lines in your HTML code.

The browser will remove extra spaces and extra lines when the page is displayed.

Any number of spaces, and any number of new lines, count as only one space.

Example
<p>
This paragraph
contains a lot of lines
in the source code,
but the browser
ignores it.
</p>

<p>
[Link] 1/4
9/2/2015 HTML Paragraphs

This paragraph
contains a lot of spaces
in the source code,
but the browser
ignores it.
</p>

Try it Yourself » ([Link]?filename=tryhtml_paragraphs2)

Don't Forget the End Tag


Most browsers will display HTML correctly even if you forget the end tag:

Example
<p>This is a paragraph
<p>This is another paragraph

Try it Yourself » ([Link]?filename=tryhtml_paragraphs0)

The example above will work in most browsers, but do not rely on it.

Forgetting the end tag can produce unexpected results or errors.

Stricter versions of HTML, like XHTML, do not allow you to skip the end tag.

HTML Line Breaks


The HTML <br> element defines a line break.

Use <br> if you want a line break (a new line) without starting a new paragraph:

Example
<p>This is<br>a para<br>graph with line breaks</p>

Try it Yourself » ([Link]?filename=tryhtml_paragraphs)

The <br> element is an empty HTML element. It has no end tag.

The Poem Problem


[Link] 2/4
9/2/2015 HTML Paragraphs

Example
<p>This poem will display as one line:</p>
<p>
My Bonnie lies over the ocean.

My Bonnie lies over the sea.

My Bonnie lies over the ocean.

Oh, bring back my Bonnie to me.


</p>

Try it Yourself » ([Link]?filename=tryhtml_poem)

The HTML <pre> Element


The HTML <pre> element defines preformatted text.

The text inside a <pre> element is displayed in a fixed­width font (usually Courier), and it preserves
both spaces and line breaks:

Example
<pre>
My Bonnie lies over the ocean.

My Bonnie lies over the sea.

My Bonnie lies over the ocean.

Oh, bring back my Bonnie to me.


</pre>

Try it Yourself » ([Link]?filename=tryhtml_pre)

Test Yourself with Exercises!


Exercise 1 » ([Link]?filename=exercise_paragraphs)

Exercise 2 » ([Link]?filename=exercise_paragraphs1)

Exercise 3 » ([Link]?filename=exercise_paragraphs2)

Exercise 4 » ([Link]?filename=exercise_paragraphs3)

[Link] 3/4
9/2/2015 HTML Paragraphs

HTML Tag Reference


W3Schools' tag reference contains additional information about HTML elements and their attributes.

Tag Description

<p> (/tags/tag_p.asp) Defines a paragraph

<br> (/tags/tag_br.asp) Inserts a single line break

<pre> (/tags/tag_pre.asp) Defines pre­formatted text

« Previous (html_headings.asp) Next Chapter » (html_styles.asp)

Copyright 1999­2015 (/about/about_copyright.asp) by Refsnes Data. All Rights Reserved.

[Link] 4/4
9/2/2015 Exercise v1.3

Exercise:
Add a paragraph to this document with the text "Hello World!".

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html>
<body>

</body>
</html>

Exercise ­ © [Link]
[Link] 1/1
9/2/2015 Exercise v1.3

Exercise:
Fix the display of the poem below. Display the poem over 4 lines.

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html> My Bonnie lies over the ocean. My Bonnie lies
<body> over the sea. My Bonnie lies over the ocean. Oh,
bring back my Bonnie to me.
<p>
My Bonnie lies over the ocean.
My Bonnie lies over the sea.
My Bonnie lies over the ocean.
Oh, bring back my Bonnie to me.
</p>

</body>
</html>

Exercise ­ © [Link]
[Link] 1/1
Print Page

HTML Styles
« Previous (html_paragraphs.asp) Next Chapter » (html_formatting.asp)

I am Red
I am Blue
Try it Yourself » ([Link]?filename=tryhtml_styles_intro)

HTML Styling
Every HTML element has a default style (background color is white and text color is black).

Changing the default style of an HTML element, can be done with the style attribute.

This example changes the default background color from white to lightgrey:

Example
<body style="background‐color:lightgrey">

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>

Try it Yourself » ([Link]?filename=tryhtml_styles_background­color)

The bgcolor attribute, supported in older versions of HTML, is not valid in HTML5.

The HTML Style Attribute


The HTML style attribute has the following syntax:
style="property:value"

The property is a CSS property. The value is a CSS value.

You will learn more about CSS later in this tutorial.

HTML Text Color


The color property defines the text color to be used for an HTML element:

Example
<h1 style="color:blue">This is a heading</h1>
<p style="color:red">This is a paragraph.</p>

Try it Yourself » ([Link]?filename=tryhtml_styles_color)

HTML Fonts
The font­family property defines the font to be used for an HTML element:

Example
<h1 style="font‐family:verdana">This is a heading</h1>
<p style="font‐family:courier">This is a paragraph.</p>

Try it Yourself » ([Link]?filename=tryhtml_styles_font­family)

The <font> tag, supported in older versions of HTML, is not valid in HTML5.

HTML Text Size


The font­size property defines the text size to be used for an HTML element:

Example
<h1 style="font‐size:300%">This is a heading</h1>
<p style="font‐size:160%">This is a paragraph.</p>
Try it Yourself » ([Link]?filename=tryhtml_styles_font­size)

HTML Text Alignment


The text­align property defines the horizontal text alignment for an HTML element:

Example
<h1 style="text‐align:center">Centered Heading</h1>
<p>This is a paragraph.</p>

Try it Yourself » ([Link]?filename=tryhtml_styles_text­align)

The <center> tag, supported in older versions of HTML, is not valid in HTML5.

Chapter Summary
Use the style attribute for styling HTML elements
Use background­color for background color
Use color for text colors
Use font­family for text fonts
Use font­size for text sizes
Use text­align for text alignment

Test Yourself with Exercises!


Exercise 1 » ([Link]?filename=exercise_styles1)

Exercise 2 » ([Link]?filename=exercise_styles2)

Exercise 3 » ([Link]?filename=exercise_styles3)

Exercise 4 » ([Link]?filename=exercise_styles4)

Exercise 5 » ([Link]?filename=exercise_styles5)

Exercise 6 » ([Link]?filename=exercise_styles6)

« Previous (html_paragraphs.asp) Next Chapter » (html_formatting.asp)


Copyright 1999­2015 (/about/about_copyright.asp) by Refsnes Data. All Rights Reserved.
Exercise:
Change the text color of the paragraph to "blue".

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html> This is a paragraph.
<body>

<p style="color:red">This is a paragraph.


</p>

</body>
</html>

Exercise ­ © [Link]
Exercise:
Change the font of the paragraph to "courier".

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html> This is a paragraph.
<body>

<p>This is a paragraph.</p>

</body>
</html>

Exercise ­ © [Link]
Exercise:
Center align the paragraph.

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html> This is a paragraph.
<body>

<p>This is a paragraph.</p>

</body>
</html>

Exercise ­ © [Link]
Exercise:
Change the text size of the paragraph to 200%.

Hint

Correct Code: Correct Result: Hide Answer

<!DOCTYPE html>
<html>
<body>
This is a paragraph.
<p style="font‐size:200%">This is a
paragraph.</p>

</body>
</html>

Exercise ­ © [Link]
Exercise:
Change the background color of the page below to yellow.

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html>
<body> This is a heading
<h1>This is a heading</h1>
This is a paragraph.
<p>This is a paragraph.</p>

</body>
</html>

Exercise ­ © [Link]
Exercise:
Center align all content on the page.

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html>
<body> This is a heading
<h1>This is a heading</h1>
This is also a heading
<h2>This is also a heading</h2>
This is a paragraph.
<p>This is a paragraph.</p>
This is also paragraph.
<p>This is also paragraph.</p>

</body>
</html>

Exercise ­ © [Link]
Print Page

HTML Text Formatting Elements


« Previous (html_styles.asp) Next Chapter » (html_quotation_element

Text Formatting
This text is bold
This text is italic
This is superscript

HTML Formatting Elements


In the previous chapter, you learned about HTML styling, using the HTML style attribute.

HTML also defines special elements, for defining text with a special meaning.

HTML uses elements like <b> and <i> for formatting output, like bold or italic text.

Formatting elements were designed to display special types of text:

Bold text
Important text
Italic text
Emphasized text
Marked text
Small text
Deleted text
Inserted text
Subscripts
Superscripts

HTML Bold and Strong Formatting


The HTML <b> element defines bold text, without any extra importance.

Example
<p>This text is normal.</p>

<p><b>This text is bold</b>.</p>


Try it Yourself » ([Link]?filename=tryhtml_formatting_b)

The HTML <strong> element defines strong text, with added semantic "strong" importance.

Example
<p>This text is normal.</p>

<p><strong>This text is strong</strong>.</p>

Try it Yourself » ([Link]?filename=tryhtml_formatting_strong)

HTML Italic and Emphasized Formatting


The HTML <i> element defines italic text, without any extra importance.

Example
<p>This text is normal.</p>

<p><i>This text is italic</i>.</p>

Try it Yourself » ([Link]?filename=tryhtml_formatting_i)

The HTML <em> element defines emphasized text, with added semantic importance.

Example
<p>This text is normal.</p>

<p><em>This text is emphasized</em>.</p>

Try it Yourself » ([Link]?filename=tryhtml_formatting_em)

Browsers display <strong> as <b>, and <em> as <i>.

However, there is a difference in the meaning of these tags: <b> and <i> defines
bold and italic text,
but <strong> and <em> means that the text is "important".

HTML Small Formatting


The HTML <small> element defines small text:

Example
<h2>HTML <small>Small</small> Formatting</h2>

Try it Yourself » ([Link]?filename=tryhtml_formatting_small)

HTML Marked Formatting


The HTML <mark> element defines marked or highlighted text:

Example
<h2>HTML <mark>Marked</mark> Formatting</h2>

Try it Yourself » ([Link]?filename=tryhtml_formatting_mark)

HTML Deleted Formatting


The HTML <del> element defines deleted (removed) of text.

Example
<p>My favorite color is <del>blue</del> red.</p>

Try it Yourself » ([Link]?filename=tryhtml_formatting_del)

HTML Inserted Formatting


The HTML <ins> element defines inserted (added) text.

Example
<p>My favorite <ins>color</ins> is red.</p>

Try it Yourself » ([Link]?filename=tryhtml_formatting_ins)


HTML Subscript Formatting
The HTML <sub> element defines subscripted text.

Example
<p>This is <sub>subscripted</sub> text.</p>

Try it Yourself » ([Link]?filename=tryhtml_formatting_sub)

HTML Superscript Formatting


The HTML <sup> element defines superscripted text.

Example
<p>This is <sup>superscripted</sup> text.</p>

Try it Yourself » ([Link]?filename=tryhtml_formatting_sup)

Test Yourself with Exercises!


Exercise 1 » ([Link]?filename=exercise_formatting1)

Exercise 2 » ([Link]?filename=exercise_formatting2)

Exercise 3 » ([Link]?filename=exercise_formatting3)

Exercise 4 » ([Link]?filename=exercise_formatting4)

Exercise 5 » ([Link]?filename=exercise_formatting5)

HTML Text Formatting Elements


Tag Description

<b> (/tags/tag_b.asp) Defines bold text

<em> Defines emphasized text


(/tags/tag_em.asp)
<i> (/tags/tag_i.asp) Defines italic text

<small> Defines smaller text


(/tags/tag_small.asp)

<strong> Defines important text


(/tags/tag_strong.asp)

<sub> Defines subscripted text


(/tags/tag_sub.asp)

<sup> Defines superscripted text


(/tags/tag_sup.asp)

<ins> Defines inserted text


(/tags/tag_ins.asp)

<del> Defines deleted text


(/tags/tag_del.asp)

<mark> Defines marked/highlighted text


(/tags/tag_mark.asp)

« Previous (html_styles.asp) Next Chapter » (html_quotation_element

Copyright 1999­2015 (/about/about_copyright.asp) by Refsnes Data. All Rights Reserved.


Exercise:
Add extra importance to the word "degradation" in the paragraph below.

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html>
<body> What Does WWF Do?
<h1>What Does WWF Do?</h1>
WWF's mission is to stop the degradation of our
<p>WWF's mission is to stop the planet's natural environment.
degradation of our planet's natural
environment.</p>

</body>
</html>

Exercise ­ © [Link]
Exercise:
Emphasize the word "metropolitan" in the text below.

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html>
<body> Tokyo
<h1>Tokyo</h1>
Tokyo is the capital of Japan, the center of the
<p>Tokyo is the capital of Japan, the Greater Tokyo Area, and the most populous
center of the Greater Tokyo Area, and the metropolitan area in the world.
most populous metropolitan area in the
world.</p>

</body>
</html>

Exercise ­ © [Link]
Exercise:
Highlight the word "FUN!" in the text below.

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html> HTML is FUN to learn!
<body>

<p>HTML is FUN to learn!</p>

</body>
</html>

Exercise ­ © [Link]
Hiring 50 Java Architects
Earn $100k USD & Work From Home! Apply now through Crossover.

Exercise:
Apply subscript formatting to the number "2" in the text below.

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html> H2O is the scientific term for water.
<body>

<p>H2O is the scientific term for water.


</p>

</body>
</html>

Exercise ­ © [Link]
Senior Frontend Developer
Earn $60k USD & Work From Home! Apply now through Crossover.

Exercise:
Add a line through (strikeout) the letters "blue" in the text below.

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html> My favorite color is blue red.
<body>

<p>My favorite color is blue red.</p>

</body>
</html>

Exercise ­ © [Link]
Print Page

HTML Quotation and Citation Elements


« Previous (html_formatting.asp) Next Chapter » (html_computercode_ele

Quotation

Here is a quote from WWF's website:


For 50 years, WWF has been protecting the future of nature. The world's leading
conservation organization, WWF works in 100 countries and is supported by 1.2 million
members in the United States and close to 5 million globally.

HTML <q> for Short Quotations


The HTML <q> element defines a short quotation.

Browsers usually insert quotation marks around the <q> element.

Example
<p>WWF's goal is to: <q>Build a future where people live in harmony with
nature.</q></p>

Try it Yourself » ([Link]?filename=tryhtml_formatting_q)

HTML <blockquote> for Long Quotations


The HTML <blockquote> element defines a quoted section.

Browsers usually indent <blockquote> elements.

Example
<p>Here is a quote from WWF's website:</p>
<blockquote cite="[Link]
For 50 years, WWF has been protecting the future of nature.
The world's leading conservation organization,
WWF works in 100 countries and is supported by
1.2 million members in the United States and
close to 5 million globally.
</blockquote>
Try it Yourself » ([Link]?filename=tryhtml_formatting_blockquote)

HTML <abbr> for Abbreviations


The HTML <abbr> element defines an abbreviation or an acronym.

Marking abbreviations can give useful information to browsers, translation systems and search­
engines.

Example
<p>The <abbr title="World Health Organization">WHO</abbr> was founded in
1948.</p>

Try it Yourself » ([Link]?filename=tryhtml_formatting_abbr)

HTML <address> for Contact Information


The HTML <address> element defines contact information (author/owner) of a document or article.

The <address> element is usually displayed in italic. Most browsers will add a line break before and
after the element.

Example
<address>
Written by Jon Doe.<br>
Visit us at:<br>
[Link]<br>
Box 564, Disneyland<br>
USA
</address>

Try it Yourself » ([Link]?filename=tryhtml_formatting_address)

HTML <cite> for Work Title


The HTML <cite> element defines the title of a work.

Browsers usually display <cite> elements in italic.

Example
<p><cite>The Scream</cite> by Edward Munch. Painted in 1893.</p>

Try it Yourself » ([Link]?filename=tryhtml_formatting_cite)

HTML <bdo> for Bi­Directional Override


The HTML <bdo> element defines bi­directional override.

The <bdo> element is used to override the current text direction:

Example
<bdo dir="rtl">This text will be written from right to left</bdo>

Try it Yourself » ([Link]?filename=tryhtml_formatting_bdo)

Test Yourself with Exercises!


Exercise 1 » ([Link]?filename=exercise_quotations1)

Exercise 2 » ([Link]?filename=exercise_quotations2)

Exercise 3 » ([Link]?filename=exercise_quotations3)

Exercise 4 » ([Link]?filename=exercise_quotations4)

HTML Quotation and Citation Elements


Tag Description

<abbr> Defines an abbreviation or acronym


(/tags/tag_abbr.asp)

<address> Defines contact information for the author/owner of a


(/tags/tag_address.asp) document

<bdo> (/tags/tag_bdo.asp) Defines the text direction

<blockquote> Defines a section that is quoted from another source


(/tags/tag_blockquote.asp)
<cite> (/tags/tag_cite.asp) Defines the title of a work

<q> (/tags/tag_q.asp) Defines a short inline quotation

« Previous (html_formatting.asp) Next Chapter » (html_computercode_ele

Copyright 1999­2015 (/about/about_copyright.asp) by Refsnes Data. All Rights Reserved.


Exercise:
Use an HTML element to add quotation marks around the letters "cool".

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html>
<html> I am so cool.
<body>

<p>I am so cool.</p>

</body>
</html>

Exercise ­ © [Link]
Exercise:
The text below should be a quoted section.
Add the proper HTML element to it, and specify that it is quoted from the following URL:
[Link]

Hint

Edit This Code: See Result » Result: Show Answer

<!DOCTYPE html> For 50 years, WWF has been protecting the


<html>
future of nature. The world's leading
<body>
conservation organization, WWF works in 100
For 50 years, WWF has been protecting the
countries and is supported by 1.2 million
future of nature. members in the United States and close to 5
The world's leading conservation million globally.
organization,
WWF works in 100 countries and is
supported by
1.2 million members in the United States
and
close to 5 million globally.

</body>
</html>

Exercise ­ © [Link]
Exercise:
Make the text below go right­to­left.

Hint

Correct Code: Correct Result: Hide Answer

<!DOCTYPE html> !yad lufituaeb a tahW


<html>
<body>

<bdo dir="rtl">What a beautiful day!</bdo>

</body>
</html>

Exercise ­ © [Link]
Exercise:
The letters "WHO" in the text below is an abbreviation of "World Health Organization".
Use an HTML element to provide the specified abbreviation of "WHO".

Hint

Correct Code: Correct Result: Hide Answer

<!DOCTYPE html>
<html> The WHO was founded in 1948.
<body>

<p>The <abbr title="World Health


Organization">WHO</abbr> was founded in
1948.</p>

</body>
</html>

Exercise ­ © [Link]
Print Page

HTML Computer Code Elements


« Previous (html_quotation_elements.asp)
Next Chapter » (html_comments.asp)

Computer Code
var person = {
firstName:"John",
lastName:"Doe",
age:50,
eyeColor:"blue"
}

HTML Computer Code Formatting


Normally, HTML uses variable letter size, and variable letter spacing.

This is not wanted when displaying examples of computer code.

The <kbd>, <samp>, and <code> elements all support fixed letter size and spacing.

HTML Keyboard Formatting


The HTML <kbd> element defines keyboard input:

Example
<p>To open a file, select:</p>

<p><kbd>File | Open...</kbd></p>

Try it Yourself » ([Link]?filename=tryhtml_formatting_kbd)

HTML Sample Formatting


The HTML <samp> element defines a computer output:

Example
<samp>
[Link] login: Apr 12 09:10:17
Linux 2.6.10‐grsec+gg3+e+fhs6b+nfs+gr0501+++p3+c4a+gr2b‐reslog‐v6.189
</samp>

Try it Yourself » ([Link]?filename=tryhtml_formatting_samp)

HTML Code Formatting


The HTML <code> element defines programming code:

Example
<code>
var person = { firstName:"John", lastName:"Doe", age:50, eyeColor:"blue" }
</code>

Try it Yourself » ([Link]?filename=tryhtml_formatting_code)

The <code> element does not preserve extra whitespace and line­breaks:

Example
<p>Coding Example:</p>

<code>
var person = {
firstName:"John",
lastName:"Doe",
age:50,
eyeColor:"blue"
}
</code>

Try it Yourself » ([Link]?filename=tryhtml_formatting_codelines)

To fix this, you must wrap the code in a <pre> element:

Example
<p>Coding Example:</p>

<code>
<pre>
var person = {
firstName:"John",
lastName:"Doe",
age:50,
eyeColor:"blue"
}
</pre>
</code>

Try it Yourself » ([Link]?filename=tryhtml_formatting_codepre)

HTML Variable Formatting


The HTML <var> element defines a mathematical variable:

Example
<p>Einstein wrote:</p>

<p><var>E = m c<sup>2</sup></var></p>

Try it Yourself » ([Link]?filename=tryhtml_formatting_var)

Test Yourself with Exercises!


Exercise 1 » ([Link]?filename=exercise_computercode_elements1)

Exercise 2 » ([Link]?filename=exercise_computercode_elements2)

Exercise 3 » ([Link]?filename=exercise_computercode_elements3)

HTML Computer Code Elements


Tag Description

<code> Defines programming code


(/tags/tag_code.asp)

<kbd> Defines keyboard input


(/tags/tag_kbd.asp)

<samp> Defines computer output


(/tags/tag_samp.asp)

<var> Defines a mathematical variable


(/tags/tag_var.asp)

<pre> Defines preformatted text


(/tags/tag_pre.asp)

« Previous (html_quotation_elements.asp)
Next Chapter » (html_comments.asp)

Copyright 1999­2015 (/about/about_copyright.asp) by Refsnes Data. All Rights Reserved.


Print Page

HTML Comments
« Previous (html_computercode_elements.asp)
Next Chapter » (html_css.asp)

Comment tags <!­­ and ­­> are used to insert comments in HTML.

HTML Comment Tags


You can add comments to your HTML source by using the following syntax:

<!‐‐ Write your comments here ‐‐>

Note: There is an exclamation point (!) in the opening tag, but not in the closing tag.

Comments are not displayed by the browser, but they can help document your HTML.

With comments you can place notifications and reminders in your HTML:

Example
<!‐‐ This is a comment ‐‐>

<p>This is a paragraph.</p>

<!‐‐ Remember to add more information here ‐‐>

Try it Yourself » ([Link]?filename=tryhtml_comment)

Comments are also great for debugging HTML, because you can comment out HTML lines of code,
one at a time, to search for errors:

Example
<!‐‐ Do not display this at the moment
<img border="0" src="pic_mountain.jpg" alt="Mountain">
‐‐>

Try it Yourself » ([Link]?filename=tryhtml_comment_out)


Conditional Comments
You might stumble upon conditional comments in HTML:

<!‐‐[if IE 8]>
.... some HTML here ....
<![endif]‐‐>

Conditional comments defines HTML tags to be executed by Internet Explorer only.

Software Program Tags


HTML comments tags can also be generated by various HTML software programs.

For example <!­­webbot bot­­> tags wrapped inside HTML comments by FrontPage and Expression
Web.

As a rule, let these tags stay, to help support the software that created them.

Test Yourself with Exercises!


Exercise 1 » ([Link]?filename=exercise_comments1)

Exercise 2 » ([Link]?filename=exercise_comments2)

« Previous (html_computercode_elements.asp)
Next Chapter » (html_css.asp)

Copyright 1999­2015 (/about/about_copyright.asp) by Refsnes Data. All Rights Reserved.

You might also like