HTML mark
Created By: chatGPT
HTML (HyperText Markup Language) is the standard language for creating web pages. HTML elements are made up of tags, each describing a different part of the document. Here’s a simple example of an HTML document:
<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is a paragraph on my webpage.</p>
</body>
</html>
Tags are enclosed in angle brackets (
< >
) and usually come in pairs, with an opening tag and a closing tag. The closing tag includes a forward slash (/
). For example, the <p>
tag is used to define a paragraph, while the closing tag is </p>
. Here’s how to create a list in HTML: <ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
Attributes provide additional information about an HTML element and are placed inside the opening tag. Common attributes include
id
, class
, style
, and href
. Here's an example of an anchor tag with an href
attribute: <a href="https://www.example.com">Visit Example.com</a>
To add an image to an HTML page, you can use the
<img>
tag. This tag is self-closing and requires the src
attribute, which specifies the image source URL, and the alt
attribute for accessibility. Example: <img src="image.jpg" alt="Description of image">
Forms are essential for collecting user input. You can create a form using the
Finally, always remember to validate your HTML code to ensure it follows the standards set by the World Wide Web Consortium (W3C). You can use tools like the W3C Markup Validation Service to check for errors. This helps in maintaining webpage compatibility across different browsers.<form>
tag, and various input elements (like text fields and buttons) can be added within it. Here’s a basic example of a form: <form action="/submit" method="post">
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<input type="submit" value="Submit">
</form>