HTML stands for Hyper Text Markup Language. It is a way of displaying information on webpages in your browser, HTML is so important because it gives structure to webpages. It is a markup language and it is used to display information on web browsers.
You can create a html file by adding the ‘.html’ extension to a plain text file. Then you can start writing your html in it.
Without HTML our websites would have no structure to them, Html helps structure our websites and give semantic meaning to them.
What is meant by semantic meaning? It means using HTML tags effectively to describe the purpose of elements on a page. Semantic HTML code communicates the meaning of its elements to both computers and humans, which helps web browsers, search engines, assistive technologies, and human developers understand the components of a web page.
Here are links to some really cool websites with good structure:
There are two types of HTML elements, elements with a start tag</> and end tag</>, with this type of elements, content is placed between the start and end tag. An example is the heading H1 tag, it opens and closes (<H1>Heading</H1>), and content can be placed in between.
The elements with no closing tags are called empty elements. An example is the break tag(<br>).
Examples of HTML Tags:
Container Tags:
HTML
It is used as
<html></html>
It is the building tag for HTML. If you are creating an HTML file you have to incorporate all your content inside HTML tag.
DOCTYPE
It is used to define the document type. It is not an HTML tag. It is declared before the HTML tag as it is the instruction to the website which says that the document ahead is HTML type. It is declared using syntax (for HTML5):
<!DOCTYPE html>
HEAD
Once you open the HTML tag, the head tag should be the first thing to come. It is the tag which does not contain any text but encompasses all the other tags. Tittle, style, Meta etc. all the tags are written inside it. It is used to describe the content on the website.
Syntax:
<head></head>
TITLE
This tag is used when you want to give a title to your content. The title tag also comes under the head tag. It does not include any other tag inside it. Only text can be written inside this tag.
Example:
<title> this is heading<\title>
BODY
Anything which you see on the website is written under this tag. So the content which you want should be visible to people, has to be incorporated into body tag. One thing to remember is this comes after the head tag.
An example to use it is:
<Body>this is the body</body>
DIV
The div tag, also known as the division tag, is used to define the division of the content in the file. It often acts as a container for the other elements or tags in the file. This is usually used for styling the content in the file. It is used as
<div></div>
SPAN
It is used to wrap the entire text in the file. It is basically used to group the inline content of the file. It is used as:
<span></span>
A
This is the hyperlink tag. In this tag, you can pass a link of page or website where you will like to direct the viewer. It consists of “href” attribute which is very important as the destination is passed into this attribute.
Example:
<a href="https://www.ggogle.com">google</a>.
There are more tags, but not to overwhelm. We stop here for now
References: