To introduce HTML let’s start with definition so,
HTML consists of a series of elements and describes the structure of Web page.
HTML elements tell the browser how to display the content
HTML elements are represented by tags and these tells how to display the content.
HTML Document Structure:
- An HTML document is a plain text file with the “.html” file extension.
- It consists of a series of elements that define the structure and content of the web page.
Below code shows our first HTML document
<!DOCTYPE html> <html> <head> <title>Page Title goes here...</title> </head> <body> <h1>TechLearnings Heading</h1> <p>TechLearnings Paragraph</p> </body> </html>
<!DOCTYPE html> <html> <head> <title>Page title goes here...</title> </head> <body> <h1>This is a Heading</h1> <p>This is a paragraph</p> </body> <div class="tl-list-heading"><span>HTML Tags</span></div> HTML tags (also called as HTML elements) are surrounded by angle brackets <tag_name> Content inside tags... </tag_name>
When HTML pages are rendered on web broswer, browser engine transforms HTML documents and other resources of a web page, into an interactive visual representation on web broswer (or other user's device).
The <!DOCTYPE> declaration represents the document type, and helps browsers to display web pages correctly.