HTML Notes
HTML Notes
1.<!DOCTYPE html>:All HTML documents must start with a document type declaration.
Example
<!DOCTYPE html>
<html>
<body>
</body>
</html>
2.The HTML document itself begins with <html> and ends with </html>.
3.The visible part of the HTML document is between <body> and </body>.
4.HTML headings are defined with the <h1> to <h6> tags.
<h1> defines the most important heading. <h6> defines the least important
heading.
5.HTML paragraphs are defined with the <p> tag.
6.HTML links are defined with the <a> tag:
Example
<a href="https://www.w3schools.com">This is a link</a>
HTML Attributes:
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:
1.HTML 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>
2.HTML Line Breaks:
The HTML <br> element defines a line break.
Example
<p>This is<br>a paragraph<br>with line breaks.</p>
3.The 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.
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>