HTML Documents
All HTML document 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>
. A Simple HTML Document Example:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is First Heading</h1>
<p>This is paragraph.</p>
</body>
</html>
Output
HTML Headings Example:
HTML headings are defined with the<h1>
to <h6>
tags.<h1>
defines the most important heading. <h6>
defines the least important
heading:A Simple HTML Heading Example:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is First Heading</h1>
<h2>This is paragraph.</h2>
<h3>This is paragraph.</h3>
</body>
</html>
Output
HTML Paragraphs Example:
HTML paragraphs are defined with the<p>
tag:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<p>This is paragraph.1</p>
<p>This is paragraph.2</p>
</body>
</html>
HTML Links
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<a href="http://paul-html-tutorial.blogspot.com">This is a link</a>
</body>
</html>
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
),
width
, and height
are provided as attributes:Example:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<img src="paultutorial.jpg" alt="paultutorial.com" width="104" height="142">
</body>
</html>
HTML Buttons
HTML buttons are defined with the<button>
tag:Example:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<button>Click me</button>
</body>
</html>
HTML Lists
HTML lists are defined with the<ul>
(unordered/bullet list) or the <ol>
(ordered/numbered list) tag, followed by <li>
tags (list items):Example:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
</body>
</html>
No comments:
Post a Comment