Saturday, November 18, 2023

HTML 5 BASICS

 HTML 5 


BASIC STRUCTURE OF HTML

<!DOCTYPE html>

<html>

<head>

    <meta charset="UTF-8">

    <title>Title of the Document</title>

</head>

<body>

    <!-- Content of the webpage goes here -->

       <h1>Heading 1</h1>

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

       <img src="image.jpg" alt="Description of the image">

       <a href="https://www.example.com">Link to example website</a>

   

    <script src="script.js"></script>

</body>

</html>

Here's a breakdown of the different parts

 <!DOCTYPE html>: Specifies that the document is an HTML5 document.

<html>: The root element of an HTML page.

<head>: Contains metadata about the HTML document, such as the character encoding and the title of the page.

<meta charset="UTF-8">: Specifies the character encoding for the document, typically set to UTF-8.

<title>: Defines the title of the document, which appears in the browser's title bar or tab.

<body>: Contains the visible content of the webpage.

<h1>: Defines a heading level 1.

<p>: Defines a paragraph.

<img>: Inserts an image into the document, with the source (src) attribute specifying the image file and the alt attribute providing alternative text for accessibility.

<a>: Creates a hyperlink, with the href attribute specifying the URL of the link.

<script src="script.js"></script>: Includes an external JavaScript file named "script.js" into the HTML document.


No comments:

Post a Comment

Introduction to Stack Data Structure