Popular
Data Science
Technology
Finance
Management
Future Tech
HTML or HyperText Markup is a markup language that helps you define the structure of your content. It combines Hypertext and Markup language and is used primarily to design web pages using a markup language.
While HTML Hypertext defines the link between web pages, a markup language defines the text document within the tag, which helps with the structure of web pages. HTML basic structure allows the creation and structure of paragraphs, sections, and links using HTML elements (the building blocks of a web page) such as tags and attributes (explained in later sections).
This guide will explore the basics of HTML, including its history, what it does, the anatomy of HTML elements, and more.
HTML stands for Hypertext Markup Language. It is the standard markup language used to create the structure and presentation of web pages. HTML basics uses a set of tags and elements to define the different components of a web page, such as headings, paragraphs, images, links, and more. Roles & Responsibilities in Business Analytics: All You Need to Know.
HTML was first created by Sir Tim Berners-Lee in late 1991 but was not released officially. It was later published as HTML 2.0 in 1995 and HTML 4.01 in late 1999, a major version of HTML.
Also known as the father of HTML, Tim proposed the first available description of HTML in the form of “HTML Tags.” HTML is now used by more than 90% of all websites.
HTML has evolved over time with various versions, a constantly evolving markup language. Here is a quick/timeline of the same-
HTML syntax refers to the rules and conventions that dictate how basic HTML code should be written. HTML basics uses a tag-based structure, where tags are enclosed in angle brackets (“< >”) and are used to define the format of different elements on a web page.
HTML basics follows a hierarchical structure, also known as the Document Object Model (DOM). The hierarchy determines the relationships and nesting of basic HTML code elements within one another.
HTML’s basic structure has a range of different use cases. Some of these are-
Also, it is important to note that since the structure of an HTML document cannot create dynamic functionality, HTML is not considered a programming language. Instead, it is now considered an official web standard.
In this section, we will explore the basics of HTML and the anatomy of its element in little more detail.
The average website includes different HTML pages. For instance- an about page, a home page, and a contact page would have separate HTML files. HTML documents are files that end either with a .html or .htm extension.
A web browser reads the HTML file and renders its content to make it easier for internet users to view it. All HTML pages have various HTML elements consisting of basic HTML tags and attributes. These HTML elements are considered the building blocks of a web page.
For instance, a tag explains to the web browser the beginning and end of the element, whereas an attribute is used to describe the characteristics of an element.
Consider the following line of content to understand this better-
His dog is quite hungry.
If we wish this line to stand by itself, we could specify that it is a paragraph by enclosing it in paragraph tags as shown below-
All the above three- the opening tag, the closing tag, and the content- together comprise the HTML element.
Apart from these, HTML elements can also have attributes that mainly contain extra information about the element you do not want to appear in the actual content. Attributes generally have an attribute name and an attribute value.
The importance of the attribute name and the attribute value is that it allows you to give your element a non-unique identifier that you can use to target it (and any other elements with the same attribute value) with style information and other similar things.
Typically, an attribute should always contain the following-
Nesting refers to the process of putting elements inside other elements. In the above example, if we want to state that his dog is quite hungry, we could wrap the word “quite” in an <strong> element, which means that the word ‘quite’ needs to be emphasized more.
<p> His dog is < strong > quite </strong> hungry.</p>
It is important here to make sure that your elements are properly nested. Like, in the above example, since we opened the <p> element first, followed by the <strong> element, we, therefore must close the <strong> element first, followed by the <p> element. The below sequence is incorrect:
<p> His dog is <strong>quite hungry.</p></strong>
You need to ensure that the elements of simple website HTML code are opened and closed so that they are inside or outside one another.
In case of an overlap, as shown in the above example, your web browser will keep trying to make the best possible guess at what you are trying to convey, which can lead to unexpected results.
A void element in HTML is a unique group of elements that only have start tags and do not have any content within them. They also do not have ending tags and can only have attributes without any content.
For example, <input type=”text”></input> is invalid HTML.
In HTML, the void elements are as follows:
To understand this better, take the <img> element in an HTML page:
<img src=”images/firefox-icon.png” alt=”My test image” />
This contains two attributes. However, there is no closing </img> tag and no inner content. This is mainly because an image element does not wrap the content to affect it. Instead, its purpose is to embed an image in the HTML page where it appears.
HTML elements in simple website HTML code typically appear in lowercase and include a start tag, an end tag, and some content.
Here we will discuss some of the common and basic HTML elements you will use to mark up the text.-
Heading elements in HTML represent various levels of section headings. Here <h1> is the highest section level, whereas <h6> is the least prominent or lowest one. While HTML contains 6 heading levels, <h1> – <h6>, you will commonly only use 3 to 4 only.
Links are an important part of the web. To be able to add a link, we need to use a simple element — <a> — “a” here is the acronym for “anchor.” You can follow the below steps to make text within your paragraph into a link-
Select some text. E.g., “Dominos Highlights.”
Now wrap the text in an <a> element, as below:
<a href=”https://www.dominis.org/en-US/about/highlights/”>Dominos Highlights</a>
The HTML paragraph element represents a paragraph. When placing <p></p> tags around text, you will ensure to make that text start on a new line. You will use <p> elements frequently when marking up regular text content:
The HTML heading elements represent different levels of section headings. Here <h1> is the highest section level and the most prominent, whereas <h6> is the lowest and least prominent one. While HTML contains 6 heading levels, <h1> – <h6>, you will commonly only use 3 to 4 only.
Since most of the web’s content is in the form of lists, basic HTML page has special elements for these. Marking up lists in HTML always consists of at least two elements. Among the most common types of ID lists are-
Also, it is important to note that each item inside the lists is put inside an <li> (list item) element.
For instance, if you wish to turn the below paragraph fragment into a list-
<p> At McDonald’s, we offer a range of items such as burgers, fries, and wraps as a part of the new menu…
This is how you do it-
We could change the markup to this
HTML Element | Description |
---|---|
<html> | The root element that represents an HTML document |
<head> | Contains meta information, title, scripts, and styles for the page |
<body> | Represents the content of the HTML document |
<div> | A container that groups and organizes content |
<p> | Defines a paragraph of text |
<a> | Creates a hyperlink to another web page or resource |
<img> | Inserts an image into the webpage |
<table> | Represents tabular data |
<form> | Used to create interactive input forms |
<h1> – <h6> | Headings of different sizes for hierarchical structure |
<ul> | Defines an unordered list |
<li> | Represents an item in a list |
<input> | Creates an input field |
<button> | Generates a clickable button element |
<span> | Used to style and group inline elements |
Please note that this is not an exhaustive list, as HTML offers many more elements for various purposes.
There are five important rules for coding with HTML tags.
In learning HTML basics program, you can easily add multimedia elements to your web pages to enhance their visual appeal and provide a richer user experience. Use the <img> tag to add images and specify the source (src) attribute with the image file’s URL.
Adding images and multimedia elements to web pages can greatly enhance the visual appeal and engagement of your content. HTML basic program provides various tags and features to easily incorporate images, videos, audio, and other multimedia components.
The DevOps Playbook
Simplify deployment with Docker containers.
Streamline development with modern practices.
Enhance efficiency with automated workflows.
Popular
Data Science
Technology
Finance
Management
Future Tech
Accelerator Program in Business Analytics & Data Science
Integrated Program in Data Science, AI and ML
Certificate Program in Full Stack Development with Specialization for Web and Mobile
Certificate Program in DevOps and Cloud Engineering
Certificate Program in Application Development
Certificate Program in Cybersecurity Essentials & Risk Assessment
Integrated Program in Finance and Financial Technologies
Certificate Program in Financial Analysis, Valuation and Risk Management
© 2024 Hero Vired. All rights reserved