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:
rsgs
2018-12-26 22:40:27 +00:00
committed by Manish Giri
parent 3a6ec39739
commit 8f05a7af67

View File

@ -4,18 +4,31 @@ title: Basic HTML
## 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: ### Basic Page Structure:
```html ```html
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<!-- other elements -->
</head> </head>
<body> <body>
<!-- other elements -->
</body> </body>
</html> </html>
``` ```
### Sample HTML Program ### Sample HTML Program
```html ```html