To begin, let’s start with the basic structure of an HTML document. Every HTML document must have a head and a body. The head contains information about the document, such as the title of the webpage, meta-data and links to CSS and JavaScript files. The body contains the content that is displayed on the webpage.
Here is an example of a basic HTML document structure:
<!DOCTYPE html> <html> <head> <title>My Webpage</title> </head> <body> <h1>Welcome to my webpage!</h1> <p>This is my first webpage created using HTML.</p> </body> </html>
The first line <!DOCTYPE html> is the document type declaration and it is used to specify that this is an HTML5 document. The <html> element is the root element of an HTML page, and it is used to contain all other HTML elements.
The <head> element contains information about the document, such as the title of the webpage, meta-data and links to CSS and JavaScript files.
The <title> element is placed within the head and it is used to specify the title of the webpage, which is displayed in the browser’s title bar or tab.
The <body> element contains the content that is displayed on the webpage.In this example, we have used <h1> and <p> tags to create a heading and a paragraph respectively. The text “Welcome to my webpage!” will be displayed as a heading and “This is my first webpage created using HTML.” will be displayed as a paragraph.