Basic HTML Syntax and Structure

In this article we are going to talk about Basic HTML Syntax and Structure so HTML (Hypertext Markup Language) is standard markup language and it is used to create web pages and it provides different set of tags or codes that are used to structure and format content on webpages. this article provide you an introduction to the basic of HTML syntax and structure.

 

 

HTML Structure:

HTML documents are structured using HTML tags. we can say that an HTML tag is set of characters that define how the content of web page should be displayed. HTML tags consist of an opening tag and closing tag. opening tag begins with “<” character followed by tag name and closing tag begins with “</” followed by the tag name.

HTML document is structured in hierarchy of tags, where the top level tag is <html> tag. <html> tag encloses the entire HTML document and all other tags are nested within it. also <head> and <body> tags are two main sections of an HTML document. <head> tag contains metadata of all page such as title and links to external stylesheets and scripts. <body> tag contains content of the page such as text, images and other media.

 

 

HTML Syntax:

HTML tags are used to format content on different web pages. most commonly used tags are:

 

  1. <p>: <p> tag is used to define paragraph.

Example: <p>This is paragraph.</p>

  1. <h1>, <h2>, <h3>, <h4>, <h5>, <h6>: These tags are used to define headings of different levels with <h1> being the most important and <h6> being the least important.

Example: <h1>This is heading level 1</h1>

  1. <img>: <img> tag is used to insert images into web page.

Example: <img src=”image.jpg” alt=”image description”>

  1. <a>: <a> tag is used to create hyperlinks.

Example: <a href=”https://www.example.com”>Example Link</a>

  1. <ul> and <li>: These tags are used to create unordered lists.

Example:

<ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul>

  1. <ol> and <li>: These tags are used to create ordered lists.

Example:

<ol> <li>First Item</li> <li>Second Item</li> <li>Third Item</li> </ol>

 

 

 

In result we can say that HTML is fundamental component of web development and understanding its syntax and structure is essential for creating web pages. basic HTML syntax involves using tags to structure and format content on different web pages. HTML structure involves nesting tags within other tags and main sections of an HTML document are <head> and <body> tags. by using HTML tags developers can create visually appealing and functional web pages.

Leave a Comment