HTML Tags

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

4dHTML TAGS

1. Doctype

The doctype declaration is the first line of code in an HTML file, and it communicates to our

website which version of HTML we are working in. This simple line below is sufficient to start our

HTML file.
<!DOCTYPE>

2. HTML

The HTML elements are written after our Doctype Declaration, and wrap all of our HTML code. It is

sometimes known as the root element.


<html>

3. Head

The Head Element is used to wrap around everything you want to include on the HTML page,

that isn’t the content the page will show to viewers. This includes keywords and a page description

that would appear in search results, CSS to style content, character set declarations, and more.
<head></head>

4. Title

This sets the title of the page, which is the title that appears in the browser tab the page is loaded in.

The page title is also used to describe the page when it is bookmarked. You can write this sentence

below inside our Head element.


<title>

5. Body

The body tags contain all of the content that will appear on our webpage. This includes text, images,

videos, games, playable audio tracks, or whatever else.

We can write the body tags below all of the content that is wrapped in the Head tags.
<body>

6. H1 to H6

There are 6 levels of hierarchy HTML gives us to label our headers with. Labeling with H1 will let the

web browser know that this piece of information is the most important part of our page. An H2 will

be the second most important piece of information, and so forth down to H6. It is best to use CSS to

determine the size of our typography and only use the HTML tags to clarify the importance of our

information hierarchy to the browser.


<h1></h1>
<h2></h2>
<h3></h3>
<h4></h4>
<h5></h5>
<h6></h6>

7. P

The P tag stands for paragraph. Between this tag is where we store the paragraphs of information.
<p></p>

8. Line Break

The line break tag is used to create a line break in a paragraph or header text.
<br>

9. Commenting our HTML code

Commenting on our HTML code is an important step to communicate to potential other developers

how our file is broken down. This code will not show up on our browser. Using commenting is an

important step throughout programming to keep the code legible. You write in between the two

dashes on each side to comment.


<!--This is how you comment your code-->

10. Bold

Defines that the text should be bold.


<b>bold text</b>
11. Div

The division tag is probably one of the most used tags in HTML. It is used to wrap a section of content.

A div element is used for block-level organization and styling of page elements.
<div></div>

12. Header

The header element represents a container for introductory content or a set of navigational links.
<header></header>

13. Footer

The footer element represents a container for information such as authorship information, copyright

information, contact information, sitemap, back-to-top links, and related documents.


<footer></footer>

20. Span

A span is similar to a div, but a span element is used for inline organization and styling.
<span></span>

21. Script

The script tag is how we add Javascript or any other client-side script to our project.
<script></script>

23. Image

The img tag is used to display an image on our browser. It allows us to add in the attributes of src, alt,

height, and width. The src attribute points to where our image is stored, and pulls it to place it on the

browser. The alt attribute allows us to place a meta description text for our image that will not

show up on our browser.


<img src = "new.svg" alt = "craft" height = "100px" width = "100px" />

24. Unordered List

Defines an unordered list in which we can place list items.


<ul></ul>

25. Ordered List

Defines an ordered list in which we can place list items.


<ol></ol>

26. List Item

Defines a list item that can be placed in an unordered or ordered list. I will show an example of pets in

an unordered list below.


<ul>
<li>Dog</li>
<li>Cats</li>
<li>Turtles</li>
</ul>

27. Hyperlink

A hyperlink can be added to an HTML page by wrapping it in a <a> tag. This gives us the attribute of

href, which allows us to point to a link.


<a href=” " >Visit my website!
</a>

HTML Table
HTML table tag is used to display data in tabular form (row * column). There can be
many columns in a row.

We can create a table to display data in tabular form, using <table> element, with
the help of <tr> , <td>, and <th> elements.

In Each table, table row is defined by <tr> tag, table header is defined by <th>, and
table data is defined by <td> tags.

HTML tables are used to manage the layout of the page e.g. header section,
navigation bar, body content, footer section etc. But it is recommended to use div
tag over table to manage the layout of the page .
Tag Description

<table> It defines a table.

<tr> It defines a row in a table.

<th> It defines a header cell in a table.

<td> It defines a cell in a table.

<caption> It defines the table caption.

<colgroup> It specifies a group of one or more columns in a table for formatting.

<col> It is used with <colgroup> element to specify column properties for each column.

<tbody> It is used to group the body content in a table.

<thead> It is used to group the header content in a table.

<tfooter> It is used to group the footer content in a table.

HTML Form Tags


Let's see the list of HTML 5 form tags.

Tag Description

<form> It defines an HTML form to enter inputs by the used side.

<input> It defines an input control.

<textarea> It defines a multi-line input control.

<label> It defines a label for an input element.

<select> It defines a drop-down list.


<option> It defines an option in a drop-down list.

<button> It defines a clickable button.

Frame
Example 1:

<html>
<head>
<title>Frame tag</title>
</head>
<frameset cols="25%,50%,25%">
<frame src="frame1.html" >
<frame src="frame2.html">
<frame src="frame3.html">
</frameset>
</html>

Example 2:

<html>

<frameset rows="15%,9%,76%" bordercolor="pink">

<frameset cols="20%,80%" bordercolor="red">

<frame src="logo.html" >

<frame src="title.html" >

</frameset>

<frame src="menu.html" name="f2" >

<frameset cols="15%,85%" bordercolor="red">

<frame src=" branches.html" name="f31">


<frame src="homedes.html" name="f32">

</frameset>

</frameset>

</html>

You might also like