HTML BASICS
In this blog we will study abut some basics of HTML examples. In this we will use tags which we have not learned yet.
HTML DOCUMENTS:-
All HTML documents starts with a document declaration: <!Doctype html>. The html document itself begins with <html> and ends with </html>. The visible part of the HTML document is between <body> and ends with </body>. For Example-:
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
The <!DOCTYPE> Declaration:- The <!Doctype> declaration represents the document type, and helps browsers to display the web pages correctly. It must only appear once, at the top of the page (before any HTML tags). The <!Doctype> declaration is not a case sensitive. The <!Doctype> declaration for HTML is-:
<!DOCTYPE html>
HTML HEADINGS:- A HTML heading or HTML h tag can be defined as a title or a subtitle which you want to display on the webpage. When you place the text within the heading tags <h1>-----------</h1>, it is displayed on the browser in the bold format and size of the text depends on the number of heading.
h1 is the largest heading tag and h6 is the smallest one. So h1 is used for most important heading and h6 is used for least important.
There are six different HTML headings which are defined with the <h1> to <h6> tags, from highest level h1 (main heading) to the least level h6 (least important heading). For example-:
- <h1>Heading no. 1</h1>
- <h2>Heading no. 2</h2>
- <h3>Heading no. 3</h3>
- <h4>Heading no. 4</h4>
- <h5>Heading no. 5</h5>
- <h6>Heading no. 6</h6>
HTML PARAGRAPHS:-
HTML paragraph or HTML p tag is used to define a paragraph in a webpage. Let's take a simple example to see how it work. It is a notable point that a browser itself add an empty line before and after a paragraph. An HTML <p> tag indicates starting of new paragraph. For Example-:<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
Space Inside HTML Paragraph:-
- <p>
- I am
- going to provide
- you a tutorial on HTML
- and hope that it will
- be very beneficial for you.
- </p>
- <p>
- Look, I put here a lot
- of spaces but I know, Browser will ignore it.
- </p>
- <p>
- You cannot determine the display of HTML</p>
- <p>because resized windows may create different result.
- </p>
I am going to provide you a tutorial on HTML and hope that it will be very beneficial for you.
Look, I put here a lot of spaces but I know, Browser will ignore it.
You cannot determine the display of HTML
because resized windows may create different result.
As we can see, all the extra lines and unnecessary spaces are removed by the browser.
How to use <br> and <hr> tag with Paragraph?
- <!DOCTYPE html>
- <html>
- <head>
- </head>
- <body>
- <h2> Use of line break with pragraph tag</h2>
- <p><br>Papa and mama, and baby and Dot,
- <br>Willie and me? the whole of the lot
- <br>Of us all went over in Bimberlie's sleigh,
- <br>To grandma's house on Christmas day.
- </p>
- </body>
- </html>
- <!DOCTYPE html>
- <html>
- <head>
- </head>
- <body>
- <h2> Example to show a horizontal line with paragraphs</h2>
- <p> An HTML hr tag draw a horizontal line and separate two paragraphs with that line.<hr> it will start a new paragraph.
- </p>
- </body>
- </html>
HTML <link> TAG:-
HTML <link> tag is used to specify the relationship between the current document and external source.
The <link> tag is commonly used to link the external Stylesheet for the current document, but it can also use with link site icons. It is placed on the head section of the document.
- <link rel="stylesheet" type="text/css" href="">
Following are some specifications about the HTML <link> tag.
Display | None |
Start tag/End tag | Both Start and End tag |
Usage | textual |
Comments
Post a Comment