Introduction to HTML

HTML is a markup language used to structure the content on web pages. It provides a set of elements that define the different parts of a web page, such as headings, paragraphs, links, images, and more. These elements are enclosed in tags, which tell web browsers how to display the content. HTML isn’t a programming language; it’s a markup language that acts as the structural backbone of web documents.

In the below PDF we discuss about Introduction to HTML in detail in simple language, Hope this will help in better understanding.

HTM programming

The Building Blocks:

1.  Elements:
HTML is built around elements. Each element is represented by a pair of tags. Tags are enclosed in angle brackets, and they come in pairs – an opening tag and a closing tag. The opening tag indicates the start of an element, while the closing tag marks the end. For example, to create a paragraph of text, you’d use the <p> element with an opening and closing tag like this:

<p>This is a paragraph of text.</p>

2. Attributes:
Elements can also have attributes that provide additional information about them. Attributes are always specified in the opening tag. For example, the <a> (anchor) element is used to create links, and it has an href attribute to specify the URL the link points to:

<a href="https://www.example.com">Visit Example</a>

3. Nesting:
Elements can be nested inside one another, creating a hierarchy of content. For example, you can have a heading within a paragraph:

<p>This is a <strong>bold</strong> statement.</p>

HTML Tags for Common Elements:

HTML provides a variety of tags to structure your content. Here are some common ones:

  • <h1>, <h2>, <h3>, … <h6>: Headings of different levels.
  • <p>: Paragraphs.
  • <a>: Links.
  • <img>: Images.
  • <ul> and <ol>: Unordered and ordered lists.
  • <li>: List items.
  • <div>: A generic container for grouping content.
  • <span>: A generic container for inline content.

 

Your First HTML Page:

To create your first HTML page, follow these steps:

1.  Open a text editor like Notepad (Windows) or TextEdit (Mac).

2.  Type the following code:

<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is my first HTML page.</p>
</body>
</html>


3.  Save the file with a .html extension, e.g., my_first_page.html.

4.  Open the saved HTML file with a web browser to see your page.

Congratulations! You’ve just created a simple HTML page.

 

Related Question

 

HTML stands for Hypertext Markup Language. It is the standard markup language used to create and design web pages.


HTML is important because it provides the structure and foundation for web pages. It defines the elements and their arrangement on a webpage, allowing browsers to render content properly.


A web browser is a software application used to access and display web pages. HTML documents are interpreted by web browsers, which render the content and display it on the screen.


An HTML element is a structural component of an HTML document. It consists of a pair of tags, including an opening tag and a closing tag, and may contain content or other elements.


An HTML tag is a set of angle brackets (<>) that encloses an HTML element. Tags define the type and purpose of the element within a web page.

Relevant

Document Object Model (DOM) The

HTML Canvas Basics HTML Canvas

HTML Input Atrributes HTML input

HTML Event Attributes HTML event

HTML Global Attribute HTML global

HTML Attributes HTML attributes are

Leave a Comment

Your email address will not be published. Required fields are marked *

// Sticky ads
Your Poster