logo CBCE Skill INDIA

Welcome to CBCE Skill INDIA. An ISO 9001:2015 Certified Autonomous Body | Best Quality Computer and Skills Training Provider Organization. Established Under Indian Trust Act 1882, Govt. of India. Identity No. - IV-190200628, and registered under NITI Aayog Govt. of India. Identity No. - WB/2023/0344555. Also registered under Ministry of Micro, Small & Medium Enterprises - MSME (Govt. of India). Registration Number - UDYAM-WB-06-0031863

What is the basic syntax of HTML?


The basic syntax of HTML


The basic syntax of HTML (Hypertext Markup Language) consists of elements enclosed in angle brackets. HTML elements are the building blocks of web pages and define the structure and content of the page. Each HTML element has an opening tag, content, and a closing tag. Here's the basic syntax:

 

<element>Content goes here</element>

Here are a few key points about this syntax:

  • Opening Tag: The element starts with an opening tag enclosed in angle brackets ("<"). This tag specifies the type of element you are creating. For example, the opening tag for a paragraph element is <p>.
  • Content: The content is the actual text or other elements that the HTML element contains. It goes between the opening and closing tags. For example, in <p>This is a paragraph.</p>, "This is a paragraph." is the content of the paragraph element.
  • Closing Tag: The element ends with a closing tag, which is similar to the opening tag but includes a forward slash ("/") before the element name. For example, the closing tag for a paragraph element is </p>.

 

Here's a simple example of HTML code using this basic syntax:

<!DOCTYPE html>
<html>
<head>
  <title>My First Web Page</title>
</head>
<body>
  <h1>Hello, World!</h1>
  <p>This is a paragraph of text.</p>
</body>
</html>

In this example:

  • The `<!DOCTYPE html>` declaration defines the document type and version of HTML being used.
  • The `<html>` element is the root element of the document.
  • The `<head>` element contains meta-information about the document, such as the page title.
  • The `<title>` element sets the title that appears in the browser's title bar or tab.
  • The `<body>` element contains the visible content of the web page.
  • The `<h1>` element defines a top-level heading.
  • The `<p>` element defines a paragraph of text.

 

HTML offers many more elements for structuring content, creating links, adding images, and much more. Each element follows the basic syntax of opening and closing tags with content in between.

Thank You

Popular Post:

Give us your feedback!

Your email address will not be published. Required fields are marked *
0 Comments Write Comment