W3Schools
home HOME Tutorials | References | Examples | Forum | About
Search W3Schools :

HTML Basic
HTML HOME
HTML Introduction
HTML Get Started
HTML Basic Tags
HTML Elements
HTML Attributes
HTML Formatting
HTML Entities
HTML Links
HTML Frames
HTML Tables
HTML Lists
HTML Forms
HTML Images
HTML Background
HTML Colors
HTML Colorvalues
HTML Colornames

HTML Quick List

HTML Advanced
HTML Layout
HTML Fonts
HTML 4.0 Why
HTML Styles
HTML Head
HTML Meta
HTML URLs
HTML Scripts
HTML Attributes
HTML Events
HTML URL Encode
HTML Webserver
HTML Summary

Examples/Quiz
HTML Examples
HTML Quiz
HTML Exam

References
HTML Tag List
HTML Attributes
HTML Events
HTML Colornames
HTML Character Sets
HTML ASCII
HTML ISO-8859-1
HTML Symbols
HTML URL Encode
HTML Lang Codes
HTTP Messages

Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality

W3Schools Tutorials
W3Schools Forum

Helping W3Schools

HTML Elements

Previous Next

An HTML document consists of HTML elements.

HTML elements are defined by HTML tags.


HTML Tags

  • HTML tags are markup surrounded by angle brackets like <html>
  • HTML tags normally come in pairs like <b> and </b>
  • The first tag in a pair is the start tag, the second tag is the end tag

HTML Elements

  • An HTML element starts with a start tag
  • The element content is everything between the start and end tag
  • An HTML element ends with an end tag
  • Some HTML elements have no content
  • Some HTML elements have no end tag

Example

<html>
<body>
<p>This is my first paragraph</p>
</body>
</html>

The example above contains 3 HTML elements.

A <p> Element

The <p> element defines a paragraph in the HTML document:

<p>This is my first paragraph</p>

The element has a start tag <p> and an end tag </p>
The element content is: This is my first paragraph

A <body> Element

The <body> element defines the body of the HTML document:

<body>
<p>This is my first paragraph</p>
</body>

The element has a start tag <body> and an end tag </body>
The element content is another element (a paragraph)

An <html> Element

The <html> element defines the whole HTML document:

<html>
<body>
<p>This is my first paragraph</p>
</body>
</html>

The element has a start tag <html> and an end tag </html>
The element content is another element (the body)


Empty HTML Elements

HTML elements without content are called empty elements. Empty elements have no end tag.

<br> is an empty element without a closing tag.

In XHTML, XML, and future versions of HTML, all elements must be closed.

Adding a slash to the start tag, like <br />, is the proper way of closing empty elements, accepted by HTML, XHTML and XML.

Even if <br> works in all browsers, writing <br /> instead is more future proof.


Why Lowercase Tags?

HTML tags are not case sensitive: <P> means the same as <p>. Plenty of web sites use uppercase HTML tags in their pages.

W3Schools use lowercase tags because the World Wide Web Consortium (W3C) recommends lowercase in HTML 4, and demands lowercase tags in newer versions of (X)HTML.


Previous Next


The tools you need to build your web project!

Instant Demo

Ektron CMS400.NET Version 7.6 delivers all of the flexibility and features you need to deploy the Web site you want, quickly and efficiently.

learn more...

 

 

 

6 ways to take your site to the next level with Ektron:

Social Networking Create site stickiness through social networking. Keep it personal, relevant and interactive and they'll come back for more.
Open API Keep it open. Your site needs to be ready and able to connect to outside services. Ektron's open API gives you maximum flexibility.
Document Management Streamline content and document management. Users need to quickly and intuitively find and add information.
Content Authors Empower your content authors. Reduce IT bottlenecks by allowing business users to create and edit Web content and forms.
Taxonomy Climb to the top of search rankings. SEO tools, URL aliasing and eCommerce for your digital marketing strategy
Web 2.0 Tools Add powerful Web 2.0 tools like blogs, wikis, forums, geo-mapping, rating systems and RSS feeds easily.
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today.


Jump to: Top of Page or HOME or Printer Friendly Printer friendly page

W3Schools provides material for training only. We do not warrant the correctness of its contents. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.

Copyright 1999-2008 by Refsnes Data. All Rights Reserved.

Validate Validate W3C-WAI level A conformance icon W3Schools was converted to XHTML in December 1999
Name Registration
Domain Name
Registration & More!
WEB HOSTING
$15 Domain Name
Registration
Save $20 / year!
Buy UK Domain Names
Register Domain Names
Cheap Domain Names
Cheap Web Hosting
Best Web Hosting
PHP MySQL Hosting
Top 10 Web Hosting
UK Reseller Hosting
Web Hosting
WEB BUILDING
Website Templates
Flash Templates
Website Builder
Internet Business Opportunity
Custom Programming
FREE Trial or Demo
Web Content Manager
Forms,Web Alerts,RSS
Download XML editor
Free Flash Website
EDUCATION
US Web Design Schools
HTML Exam