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 code?


Basic syntax of HTML code

The basic syntax of HTML (Hypertext Markup Language) consists of using a set of elements and tags to structure the content of a web page. Here's an overview of the basic syntax:

 

  • Document Declaration: This is the first line of an HTML document and is not technically an HTML tag, but it informs the browser that the document is written in HTML. It looks like this:
<!DOCTYPE html>

 

 

  • HTML Element: The root element of an HTML document is `<html>`. It contains two main sections: `<head>` and `<body>`. The `<head>` section contains metadata about the document (such as the title, linked stylesheets, and scripts), while the `<body>` section contains the visible content of the web page.
<html>
<head>
    <!-- Metadata and references to external resources -->
</head>
<body>
    <!-- Visible content of the web page -->
</body>
</html>

 

 

  • Head Section: Within the `<head>` section, you can include various meta information, linked stylesheets, scripts, and more. For example:
<head>
    <title>My Web Page</title>
    <link rel="stylesheet" href="styles.css">
    <script src="script.js"></script>
</head>

 

  • Body Section: The `<body>` section contains the main content of your web page, including text, images, links, and other elements. Here's an example:
<body>
    <h1>Welcome to My Web Page</h1>
    <p>This is a paragraph of text.</p>
    <img src="image.jpg" alt="An image">
    <a href="https://www.example.com">Visit Example Website</a>
</body>

 

 

  • HTML Tags: Tags are used to define different types of elements within the HTML document. They are enclosed in angle brackets (`<` and `>`). Tags usually come in pairs: an opening tag and a closing tag. The content between the opening and closing tags defines the element's content. For example:
<tagname>content</tagname>

Examples include `<h1>` for headings, `<p>` for paragraphs, `<img>` for images, `<a>` for links, and more.

 

Remember that HTML is a language for describing the structure of web content. It provides the foundation for a web page but doesn't control its appearance or interactivity directly. CSS (Cascading Style Sheets) is used for styling, and JavaScript is used for interactivity.

Thank You

Popular Post:

Give us your feedback!

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