HTML Tutorials

What is HTML?

HTML (Hypertext Markup Language) is a markup language used to create and structure content for the web. It is a set of markup tags and attributes that define the structure and appearance of web pages. HTML documents can be displayed on web browsers like Google Chrome, Firefox, and Safari.

HTML Introduction

HTML provides a way to structure content by defining different types of elements, such as headings, paragraphs, lists, tables, images, and links. Each element is defined by an opening tag, some content, and a closing tag. Attributes can also be added to elements to provide additional information or functionality.

For example, the following HTML code creates a simple web page with a heading, paragraph, and link:

<!DOCTYPE html>
<html>
<head>
	<title>My Web Page</title>
</head>
<body>
	<h1>Welcome to my web page</h1>
	<p>This is my first web page.</p>
	<a href="https://www.example.com">Visit Example.com</a>
</body>
</html>

When this code is rendered in a web browser, it will display a web page with a heading that says “Welcome to my web page”, a paragraph that says “This is my first web page”, and a link to Example.com.

Example Explained

This example creates a simple web page with a heading, paragraph, and link. Here’s a breakdown of the HTML code:

<!DOCTYPE html>: This declaration tells the web browser that this document is an HTML5 document.

<html>: This tag defines the beginning of an HTML document. All other HTML elements should be contained within this tag.

<head>: This tag contains meta information about the document, such as the page title and links to CSS stylesheets.

<title>My Web Page</title>: This tag sets the title of the web page to “My Web Page”. This title is displayed in the browser’s title bar and is also used by search engines when indexing the page.

<body>: This tag contains the content that is displayed on the web page.

<h1>Welcome to my web page</h1>: This tag creates a heading that says “Welcome to my web page”.

<p>This is my first web page.</p>: This tag creates a paragraph that says “This is my first web page”.

<a href="https://www.example.com">Visit Example.com</a>: This tag creates a hyperlink to the website “https://www.example.com“. The text “Visit Example.com” is displayed as the hyperlink.

Introduction

HTML is an essential building block of the web and is used in conjunction with other web technologies such as CSS and JavaScript to create interactive and dynamic web pages.

HTML uses a series of tags, which are enclosed in angle brackets, to define different elements on a web page. Tags are used to indicate the beginning and end of an element, and they can also include attributes to provide additional information about the element. For example, the <h1> tag is used to define a heading, and it can include an attribute such as “id” to give the heading a unique identifier:

<h1 id="main-heading">Welcome to my website</h1>

In this example, the <h1> tag defines a heading, and the “id” attribute gives the heading a unique identifier of “main-heading”.

HTML documents are usually created using a text editor or an integrated development environment (IDE). Once the document is created, it can be viewed in a web browser. Web browsers interpret the HTML code and display the content on the screen, according to the rules defined in the HTML standard.

HTML is constantly evolving, and new versions of the language are released periodically. The latest version of HTML is HTML5, which includes many new features and improvements to the language. HTML5 also provides support for multimedia elements such as video and audio, as well as new APIs for creating web applications.

HTML Comment Tag

You can add comments to your HTML source

<!-- Write your comments here -->
<!DOCTYPE html>
<html>
<body>


<!-- Write your comments here -->
<p>This is my text.</p>

</body>
</html>