HTML script
Created By: chatGPT
HTML, or HyperText Markup Language, is the standard markup language for creating web pages. It consists of elements that structure the web content displaying it in a browser. Here’s a simple example of an HTML document:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First HTML Page</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is a paragraph of text on my first HTML page.</p>
<a href="https://www.example.com">Click here to visit example.com</a>
</body>
</html>
In this example, we declare the document type with
<!DOCTYPE html>
, indicating that this is an HTML5 document. The <html>
element is the root of the document. Inside <head>
, we define meta tags and the page title. The <body>
element contains the content that users see, including headings, paragraphs, and links.<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First HTML Page</title>
</head>
You can create various elements in your HTML document:
- Headings: Defined by
<h1>
,<h2>
, ...,<h6>
- Paragraphs: Defined by
<p>
- Links: Defined by
<a>
- Images: Defined by
<img>
- Lists: Can be either ordered
<ol>
or unordered<ul>
.
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
To embed an image, use the
<img>
tag with the src
attribute pointing to the image URL: <img src="https://www.example.com/image.jpg" alt="Description of image">