Some Basic HTML Examples
HTML Basic Examples
Don't worry, if you are not familiar with these tags.
You will be learning them in the next upcoming chapters.
HTML Documents
Each and every HTML document must have to start with a document type declaration :
<!DOCTYPE html>.
The HTML document itself begins with <html> and ends with </html>
The visible part of the HTML document is always between <body> and </body> tag.
-
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
HTML Headings
HTML headings are defined according to the importance of the headings with the <h1> to <h6> tags.
<h1> defines the most important heading.
<h6> defines the least important heading :
Example :
<h1>This is Heading 1</h1>
<h2>This is Heading 2</h2>
<h3>This is Heading 3</h3>
<h4>This is Heading 4</h4>
<h5>This is Heading 5</h5>
<h6>This is Heading 6</h6>
HTML Paragraphs
HTML paragraphs are defined with the <p> tag :
Example :
<p>This is another paragraph.</p>
HTML Links
HTML links are defined with the <a> tag :
Example :
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), width, and height are provided as attributes :
Example :
alt=
W3Schools.comwidth="104"
height=
142/>
Comments
Post a Comment