HTML type
Created By: chatGPT
In HTML, the doctype declaration is important as it tells the web browser which version of HTML the page is written in. For HTML5, the declaration is simple:
<!DOCTYPE html>
After the doctype, you should define the html element which wraps all other elements. Here is how you start an HTML document:
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document Title</title>
</head>
<body>
<!-- Your content goes here -->
</body>
</html>
Inside the head section, you can include important metadata, like the title of the page and links to stylesheets or scripts. The body section contains the content of the webpage.
<head>
<meta name="description" content="A brief description of your webpage.">
<link rel="stylesheet" href="styles.css">
<script src="script.js"></script>
</head>
For structuring content in the body, you can use various tags such as to for headings, for paragraphs, and for division and layout purposes. Here’s an example of a simple structured page:
<body>
<header>
<h1>Welcome to My Website</h1>
</header>
<main>
<section>
<h2>About Us</h2>
<p>This is where you can write about your website.</p>
</section>
<section>
<h2>Contact</h2>
<p>Email: info@example.com</p>
</section>
</main>
<footer>
<p>© 2023 My Website</p>
</footer>
</body>
To make your page visually appealing, you often need to include CSS (Cascading Style Sheets). You can link an external stylesheet in the head section. Here’s a simple CSS example.
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
}
h1 {
color: #333;
}