tutorial on basic html structure (#26343)
Added explanation on how the structure of the html file works and explained it's elements.
This commit is contained in:
@ -4,18 +4,31 @@ title: Basic HTML
|
||||
|
||||
## Basic HTML
|
||||
|
||||
The basic structure of HTML always starts with a document type declaration: `<!DOCTYPE html>`
|
||||
|
||||
You will need to add the `<html>` tag after the document type and close it with a `</html>` tag. This will be your actual HTML document.
|
||||
|
||||
The first element you will insert in your HTML will be the `<head>` tag that will contain all metadata from the website such as its title, styles, links and other elements. This element needs to be closed with a `</head>` tag.
|
||||
|
||||
The visible part of your HTML lies within the `<body>` tag which will be inside the `<html>` tag, and will also need to be closed with a `</body>` tag.
|
||||
|
||||
Below you can see the structure of a basic HTML file:
|
||||
|
||||
|
||||
### Basic Page Structure:
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<!-- other elements -->
|
||||
</head>
|
||||
<body>
|
||||
<!-- other elements -->
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
|
||||
### Sample HTML Program
|
||||
|
||||
```html
|
||||
|
Reference in New Issue
Block a user