A simple HTML Document :
<!DOCTYPE html> <html> <head> <title>Title of the page</title> </head> <body> <h1>This is Heading</h1> <p>This is paragraph</p> </body> </html>
Explanation for the above HTML document :
1.The DOCTYPE declaration defines the document type to be HTML.2.The text between <html> and </html> describes an HTML document.3.The text between <head> and </head> provides info about the document.4.The text between <title> and </title> provides a title for the document.5.The text between <body> and </body> describes the visible page content.6.The text between <h1> and </h1> describes a heading.7.The text between <p> and </p> describes a paragraph.HEADING IN HTML :
Every document will have a heading. HTML has different sizes for headings. which use the following elements <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>. While displaying any heading, browser adds one line before and one line after that heading.Example for Heading
<!DOCTYPE html> <html> <head> <title>Heading Example</title> </head> <body> <h1>Example for heading h1</h1> <h2>Example for heading h2</h2> <h3>Example for heading h3</h3> <h4>Example for heading h4</h4> <h5>Example for heading h5</h5> <h6>Example for heading h6</h6> </body> </html>Output:Example for heading h1
Example for heading h2
Example for heading h3
Example for heading h4
Example for heading h5
Example for heading h6
PARAGRAPH IN HTML:
In HTML you can structure your text into different paragraphs by using the tag <p>.Each paragraph of text should go in between an opening <p> and a closing </p> tag .
Example for Paragraph :
<!DOCTYPE html> <html> <head> <title>Paragraph Example</title> </head> <body> <p>This is First Paragraph.</p> <p>This is Second Paragraph.</p> <p>This is Third Paragraph.</p> </body> </html> </html>Output:This is First Paragraph.This is Second Paragraph.This is Third Paragraph.LINE BREAK IN HTML :
If you use the <br> tag , anything following it starts from the next line . This tag is an example of an empty element, there is no need for opening and closing tags, as there is nothing to go in between them.Example for Line break :
<!DOCTYPE html>
<html> <head> <title>Example for Line Break </title> </head> <body> <p>This<br> is an example for<br> Line Break</p> </body> </html>Output:This is an example for Line BreakHORIZONTAL LINE :-To create a horizontal line between a section of document the <hr> tag can be used it creates a line from the current position in the document to the right margin and breaks the line accordingly .Example for horizontal line :
<!DOCTYPE html> <html> <head> <title>Horizontal Line </title> </head> <body> <p>This is above the line</p> <hr /> <p>This is below the line</p> </body> </html>Output:This is above the line
This is below the line
Nice article. It's very helpful to me. Thank you for share with us. Can you please check my web tutorial website Flox Blog Beginner's Guide for Web Developers.
ReplyDelete