02-17-2025, 10:55 PM
If you're a beginner, here's a simple HTML starter code to help you understand the basics of a webpage structure:
Basic HTML Template
Explanation of the Code:
<!DOCTYPE html> – Declares the document as HTML5.
<html lang="en"> – Defines the language of the document.
<head> – Contains metadata like title, character set, and styles.
<meta charset="UTF-8"> – Supports special characters and emojis.
<meta name="viewport" content="width=device-width, initial-scale=1.0"> – Makes the page responsive for mobile devices.
<title> – Sets the title of the webpage (shown on the browser tab).
<style> – Defines basic CSS styles inside the head.
<body> – Contains visible content like headings, paragraphs, and links.
<h1> – A heading tag for the main title.
<p> – A paragraph for descriptive text.
<a href="URL"> – A hyperlink to another website.
Would you like help adding more features, like images, buttons, or forms? ?
Basic HTML Template
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Webpage</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
background-color: #f4f4f4;
padding: 20px;
}
h1 {
color: #333;
}
</style>
</head>
<body>
<h1>Welcome to My First Webpage</h1>
<p>This is a simple webpage for beginners.</p>
<a href="https://www.w3schools.com" target="_blank">Learn More</a>
</body>
</html>
Explanation of the Code:
<!DOCTYPE html> – Declares the document as HTML5.
<html lang="en"> – Defines the language of the document.
<head> – Contains metadata like title, character set, and styles.
<meta charset="UTF-8"> – Supports special characters and emojis.
<meta name="viewport" content="width=device-width, initial-scale=1.0"> – Makes the page responsive for mobile devices.
<title> – Sets the title of the webpage (shown on the browser tab).
<style> – Defines basic CSS styles inside the head.
<body> – Contains visible content like headings, paragraphs, and links.
<h1> – A heading tag for the main title.
<p> – A paragraph for descriptive text.
<a href="URL"> – A hyperlink to another website.
Would you like help adding more features, like images, buttons, or forms? ?