0% found this document useful (0 votes)
19 views2 pages

HTML Notes

This document provides an overview of HTML basics, including the structure of an HTML document, the use of various elements like headings, paragraphs, links, and images, as well as attributes that can be applied to these elements. It emphasizes the importance of proper heading usage, styling options, and formatting elements for text. Additionally, it includes examples for clarity on how to implement these HTML components.

Uploaded by

balaji221balaji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

HTML Notes

This document provides an overview of HTML basics, including the structure of an HTML document, the use of various elements like headings, paragraphs, links, and images, as well as attributes that can be applied to these elements. It emphasizes the importance of proper heading usage, styling options, and formatting elements for text. Additionally, it includes examples for clarity on how to implement these HTML components.

Uploaded by

balaji221balaji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

HTML basics and elements:

1.<!DOCTYPE html>:All HTML documents must start with a document type declaration.
Example
<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>


<p>My first paragraph.</p>

</body>
</html>

[Link] HTML document itself begins with <html> and ends with </html>.
[Link] visible part of the HTML document is between <body> and </body>.
[Link] headings are defined with the <h1> to <h6> tags.
<h1> defines the most important heading. <h6> defines the least important
heading.
[Link] paragraphs are defined with the <p> tag.
[Link] links are defined with the <a> tag:
Example
<a href="[Link] is a link</a>

*The link's destination is specified in the "href" attribute.


[Link] images are defined with the <img> tag.
Example
The source file (src), alternative text (alt), width, and height are
provided as attributes:
[Link] <html> element is the root element.
[Link] <body> element defines the document's bod.
[Link] <h1> element defines a heading.
[Link] <p> element defines a paragraph.

HTML Attributes:

[Link] HTML elements can have attributes


[Link] href attribute of <a> specifies the URL of the page the link goes to
[Link] src attribute of <img> specifies the path to the image to be displayed
[Link] width and height attributes of <img> provide size information for images
[Link] alt attribute of <img> provides an alternate text for an image
[Link] style attribute is used to add styles to an element, such as color, font,
size, and more
[Link] lang attribute of the <html> tag declares the language of the Web page
[Link] title attribute defines some extra information about an element

Headings Are Important:


<h1> headings should be used for main headings, followed by <h2> headings, then the
less important <h3>

Bigger Headings:
the size for any heading with the style attribute, using the CSS font-size
property.
Example
<h1 style="font-size:60px;">Heading 1</h1>

HTML Paragraphs:
[Link] Horizontal Rules:
The <hr> tag defines a thematic break in an HTML page.
Example
<h1>This is heading 1</h1>
<p>This is some text.</p>
<hr>
<h2>This is heading 2</h2>
<p>This is some other text.</p>
<hr>
[Link] Line Breaks:
The HTML <br> element defines a line break.
Example
<p>This is<br>a paragraph<br>with line breaks.</p>
[Link] HTML <pre> Element:
The text inside a <pre> element is displayed in a fixed-width font (usually
Courier), and it preserves both spaces and line breaks:
Example
<pre>
My Bonnie lies over the ocean.

My Bonnie lies over the sea.

My Bonnie lies over the ocean.

Oh, bring back my Bonnie to me.


</pre>

HTML Styles:
*Use the style attribute for styling HTML elements
<tagname style="property:value;">
*Use background-color for background color
<body style="background-color:powderblue;">
*Use color for text colors
<h1 style="color:blue;">This is a heading</h1
*Use font-family for text fonts
<h1 style="font-family:verdana;">This is a heading</h1>
*Use font-size for text sizes
<h1 style="font-size:300%;">This is a heading</h1>
*Use text-align for text alignment
<h1 style="text-align:center;">Centered Heading</h1>

HTML Formatting Elements:


*<b> - Bold text
*<strong> - Important text
*<i> - Italic text
*<em> - Emphasized text
*<mark> - Marked text
*<small> - Smaller text
*<del> - Deleted text
*<ins> - Inserted text
*<sub> - Subscript text
*<sup> - Superscript text

You might also like