Creating your first html page
HTML page structure
- As we have already discussed, every HTML page is divided into two section -:
- Head Section
- Body Section
- Head section
- This is a section which is actually not visible to the users on the web page, but it helps the content how to display the content.
- It is used to write the title, meta, script, style etc.
- Body Section
- This is a section which is actually visible on the web page.
Example-1
<!doctype html>
<html>
<head>
<title>My First Web page</title>
</head>
<body>
Welcome!!! in the world of web.
</body>
</html>
Example Explained:
- <!doctype html> reprents, which html version you are using. For html-5 doctype is as written. Before html-5 doctype is too complicatd. HTML-5 simplified doctype.
- Every HTML page starts with <html></html> tag.
- Because each HTML page have head section and body section, which is represented by <head></head> and <body></body> tag respectively.
- <head></head> section contains, <title></title> tag, which reprents the page title, shown on the title bar.
- <body></body> tag contains the actual content of the page.
Run the web page
- To run the web page, save your web page with the .html extension, suppose you saved above page as first.html.
- To run the web page, open your saved page in the browser.
Comments