HTML
HTML
HTML Tags
HTML markup tags are usually called HTML tags
The first tag in a pair is the start tag, the second tag is the end tag
Start and end tags are also called opening tags and closing tags
<html>
<body>
</body>
</html>
Example Explained
The text between <html> and </html> describes the web page
The text between <body> and </body> is the visible page content
Example
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
HTML Paragraphs
HTML paragraphs are defined with the <p> tag.
Example
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
HTML Links
HTML links are defined with the <a> tag.
Example
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>
HTML Paragraphs
HTML paragraphs are defined with the <p> tag.
Example
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
HTML Links
HTML links are defined with the <a> tag.
Example
<a href="http://www.w3schools.com">This is a link</a>
HTML Images
HTML images are defined with the <img> tag.
Example
<img src="w3schools.jpg" width="104" height="142" />
Attribute Example
HTML links are defined with the <a> tag. The link address is specified in the href attribute:
Example
HTML Lines
The <hr /> tag creates a horizontal line in an HTML page.
Example
<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>
To find out, right-click in the page and select "View Source" (IE) or "View Page Source"
(Firefox), or similar for other browsers. This will open a window containing the HTML code
of the page.
Tag Description
<p> Defines a paragraph
<br /> Inserts a single line break
Example
<html>
<body style="background-color:yellow;">
<h2 style="background-color:red;">This is a heading</h2>
<p style="background-color:green;">This is a paragraph.</p>
</body>
</html>
<html>
<body>
</body>
</html>
Example
<html>
<body>
<h1 style="text-align:center;">Center-aligned heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
<html>
<body>
<p>If you set the target attribute to "_blank", the link will open in a new browser window/tab.</p>
</body>
</html>
Align Images
<html>
<body>
<p>An image
with align="bottom".</p>
<p>An image
with align="middle".</p>
<p>An image
with align="top".</p>
</body>
</html>
<body>
<a href="default.asp">
</a></p>
<a href="default.asp">
</a></p>
</body>
</html>