HTML Tags
HTML Tags
HTML 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
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
5. Body
The body tags contain all of the content that will appear on our webpage. This includes text, images,
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
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>
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
10. Bold
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
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
Defines a list item that can be placed in an unordered or ordered list. I will show an example of pets in
27. Hyperlink
A hyperlink can be added to an HTML page by wrapping it in a <a> tag. This gives us the attribute of
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
<col> It is used with <colgroup> element to specify column properties for each column.
Tag Description
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>
</frameset>
</frameset>
</html>