HTML Elements (Cont.)
Lowercase Tags or Uppercase Tags?
The World Wide Web Consortium (W3C) recommends lowercase tags in their HTML 4 recommendation, and XHTML demands lowercase tags.
Nested HTML Elements
Most HTML elements can be nested (can contain other HTML elements).
HTML documents consist of nested HTML elements.
For example, the script below contains 3 HTML elements and 2 nested elements of <body>
and <p>
:
<html><body>
<p>This is my first paragraph</p>
</body></html>
Empty HTML Elements
HTML elements without content are called empty elements.
Empty elements can be closed in the start tag.
<br>
is an empty element without a closing tag (it defines a line break).
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.
Creating Web Pages
You can easily edit HTML files using a WYSIWYG (what you see is what you get) editor such as
- Expression Web, which is a web page authoring tool from Microsoft.
- Dreamweaver, which is an HTML editor available from Adobe used to create web pages.
However, if you want to be a skillful web developer, you should use a plain text editor to learn your primer HTML.
Demonstration
The following demonstration shows how the HTML script is displayed on the Web.