HTML Headings

HTML headings are defined with the <h1> to <h6> tags. The lower the number, the larger the heading size.

HTML Paragraph

HTML paragraphs are defined with the <p> tag. Most browsers automatically put a line break and space after a </p> tag.

HTML Links

HTML links are defined with the <a> tag.

HTML Images

HTML images are defined with the <img> tag. It tells the browser where to find the image file and what size to display it, among other things.

Lets see a example

<HTML>
<head>
<title> HTML Fundamentals </title>
</head>
<body>
<h1>This is Heading 1</h1>
<h2>Heading 2 is Smaller</h2>
<h3>Heading 3 is Smaller Still</h3>

<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>

<a href=”http://unboltingbinary.in/”>This is a link to the unboltingbinary Web site.</a>

<img src=”UB.jpg”/>
</body>
</HTML>

3

HTML Attributes

1. HTML elements can have attributes
2. Attributes provide additional information about an element
3. Attributes are always specified in the start tag
4. Attributes come in name/value pairs like: name=”value”

Example:

The lang attribute: lang=”en-US”
The first two letters specify the language (en). If there is a dialect, use two more letters (US).

<!DOCTYPE html>
<html lang=”en-US”>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>

HTML Rules(Lines)

The <hr/> tag is used to create a horizontal rule (line) across the browser page. Rules are often used to separate sections of a document.

HTML Comments

Comments can be inserted in the HTML code to make it more readable and understandable. Comments are ignored by the browser and are not displayed.
Comments are written like <!–This comment will not be displayed–>

HTML Line Breaks

Use the <br/> tag if you want a line break(a new line) without starting a new paragraph. The <br/> element is an empty element. It has no end tag.

<!DOCTYPE html>
<HTML lang=”en-US”>
<body>
<h1>This is Heading 1</h1>
<h2>Heading 2 is Smaller</h2>
<h3>Heading 3 is Smaller Still</h3>

<!–This comment will not be displayed–>

<hr/>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<hr/>
<a href=”http://unboltingbinary.in/”>This is a link to the unboltingbinary Web site.</a><br><br>
<hr/>
<img src=”UB.jpg”>
</body>
</HTML>

4

Leave a Reply