<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="author" content="Dave Gray">
<meta name="description" content="This page contains link favicon icon and css how to create as I learn HTML in web designing Madurai">
<title>My First Web Page</title>
<link rel="icon" href="https://www.webgapp.com/wp-content/uploads/2023/04/webgapp-logo-edited.png" type="image/x-icon">
<link rel="stylesheet" href="main.css" type="text/css">
</head>
<body>
<h1>Hello World!</h1>
<p>This is my first web page.</p>
</body>
</html>
CSS CODE
html {
font-size: 22px;
}
body {
background-color: #333;
color: whitesmoke;
}
The provided code is an HTML document that represents a web page. Let’s break it down and explain each section:
<!DOCTYPE html>
: This is a document type declaration that specifies the document type as HTML5.
<html lang="en">
: The <html>
tag defines the root element of an HTML document. The lang
attribute specifies the language of the document, which is set to English (en
).
<head>
: The <head>
section contains meta-information and external resources for the HTML document.
<meta charset="UTF-8">
: This meta tag sets the character encoding to UTF-8, which is a standard character encoding that supports a wide range of characters and symbols.
<meta name="author" content="Dave Gray">
: This meta tag specifies the author of the web page as “Dave Gray”.
<meta name="description" content="This page contains all the things I am learning how to create as I learn HTML.">
: This meta tag provides a brief description of the web page content, stating that it contains things the author is learning as they learn HTML.
<title>My First Web Page</title>
: The <title>
tag sets the title of the web page, which will be displayed in the browser’s title bar or tab.
<link rel="icon" href="html5.png" type="image/x-icon">
: This line specifies a favicon for the web page, which is the small icon that appears in the browser tab. The href
attribute points to the location of the favicon file, in this case, “html5.png”.
<link rel="stylesheet" href="main.css" type="text/css">
: This line links an external CSS file named “main.css” to the HTML document. The CSS file contains styles that will be applied to elements on the web page.
<body>
: The <body>
tag encloses the content of the web page that will be displayed in the browser.
<h1>Hello World!</h1>
: This is a level 1 heading element (<h1>
) that displays the text “Hello World!” as a heading on the web page.
<p>This is my first web page.</p>
: This is a paragraph element (<p>
) that displays the text “This is my first web page.” as a paragraph on the web page.
Overall, the code sets the character encoding, specifies meta-information, includes external resources like CSS and favicon, and defines the content of the web page using HTML elements.