HTML TAGS |
HTML Tags:
- Tags define what will be the format of the content displayed on the web browser.
- HTML Tags mainly have two parts opening tag and a closing tag.
- HTML starting tag enclosed within <> and closing tags is enclosed within </>
- Some HTML tags are self-closing tags or these tags are called empty tags.
This will be the main template for our code to execute, we will write our source code inside the body tag and will see the result in the browser.
Now go to any folder in your PC and create a file named "index.html" and paste the code given below. And then save the file and go to your web browser.
Now copy the file path of index.html and paste in web browser.
index.html
Now, let's start with learning HTML Tags.
To execute all the given HTML Tags below copy them one by one and paste into the body tag of "index.html" and refresh your browser to see the result:
Using HTML Tags:
1). Heading
- As the name suggests heading tag is used to create the heading on web pages.
- There are 6 headings available in HTML from h1 to h6.
- h1 is the largest heading and h6 is the smallest heading.
Now to check this code copy this source code and paste it into the body tag of the "index.html". And after saving "index.html" refresh your web browser.
Output:
This is h1
This is h2
This is h3
This is h4
This is h5
This is h6
2). Navbar
<nav> tag is used to create a navbar. Copy the code given below and paste it into the "index.html" and then refresh your browser.
3). Header
<header> tag is used to create a page header.
4). Main
Used to create the main content section of the webpage.
5). Div
<div> tag is used to create division on a webpage.
6). Section
<section> is used to create the particular section. It can contain more than one HTML tag.
7). Paragraph
<p> tag is used to create a paragraph.
8). Span
<span> is used to style the part of the text.
9). Anchor
<a> tag is used to create hyperlinks. In the below code, href is the tag attribute.
10). Footer
<footer> tag is used to create a footer for the webpage. And we can use more than one tag in the footer tag.
11). Mark
<mark> tag is used to highlight the background of the text. In the given example below "This is our mark text" is will be the marked text.
This is our mark text And this is another text
12). Strike
<strike> is used to place horizontal lines on the text.
This is normal text
This is strike text
13). Button
<button> tag used to create a button on web page.
14). Small
<small> used to display small text. The text which is inside the <small> tag that text will be small as compared to normal text.
This is paragraph and This is small text
15). Pre
<pre> tag is used to create pre-formatted text. This will display the text on the web browser in which way we write on "index.html"
This is
my pre-formatted text
in HTML
16). List
<li> tag is used to create list items.
17). Code
<code> tag is used to display source code on the web page.
18). Superscript
<sup> tag is used to create superscript text.
(a+b)2
19). Subscript
<sub> tag is used to create subscript text.
H2O