Basic of HTML: Part – 1

what is HTML ?

The Hyper Text Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser

  • HTML describes the structure of a Web page
  • HTML consists of a series of elements
  • HTML elements tell the browser how to display the content

Simple HTML document

All HTML documents must start with a document type declaration: <!DOCTYPE html>.

The HTML document itself begins with <html> and ends with </html>.

The visible part of the HTML document is between <body> and </body>.

<html>  
<head>  
<title>Web page title</title>  
</head>  
<body>  
<h1>Write Your First Heading</h1>  
<p>Write Your First Paragraph.</p>  
</body>  
</html>  

HTML Tags

HTML tags are like keywords which defines that how web browser will format and display the content. With the help of tags, a web browser can distinguish between an HTML content and a simple content. HTML tags contain three main parts: opening tag, content and closing tag. But some HTML tags are unclosed tags.

An HTML file must have some essential tags so that web browser can differentiate between a simple text and HTML text. You can use as many tags you want as per your code requirement.

  • Every tag in HTML perform different tasks.
  • If you have used an open tag <tag>, then you must use a close tag </tag> (except some tags)
Syntax

<tag>content</tag>

The Heading tag

Heading tag is used to mark heading in HTML. from h1 to h6 , we have tags for the most important to the least important heading.

  • <h1> most important heading </h1>
  • <h2>another heading </h2>
  • <h3>another heading </h3>
  • <h4>another heading </h4>
  • <h5>another heading </h5>
  • <h6>another heading </h6>
The Paragraph tag

Paragraph tag are use to add paragraphs to an HTML page .

  • <p> this is a paragraph </p>
Br tag

The br tag is used to create line breaks in an HTML document.

The image tag

img tag used to add images in an HTML page.

  • <img src=”image.Jpg”>
  • Note: The relative url of an image.

Similarly to the above tags there are many other tags like these which have their own function.

Elements

An HTML element is defined by a start tag some content and an end tag.

<tagname>Content goes here…</tagname>

<h1>hello world</h1>
<p>my first paragraph </p>

The hello world in it is the element content HTML elements can be nested (this means that elements can contain other elements).All HTML documents consist of nested HTML elements.

Leave a comment