The title element is used for specifying the web page’s title. This title is shown in the browser’s top bar and is also found in other locations. If we don’t specify the title of the web page using the title element, then most browsers use the file name as the web page’s title.
Hence the title element should be carefully constructed for each web page in order to attract more viewers in the search engine results.
The meta element is an empty element used for providing metadata for the web page. Metadata means data about data. Hence the meta element provides additional data about the web page that is not shown along with the page. Since meta is an empty element, the metadata is provided through various attributes.
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width:device-width, initial scale=1.0"> <meta name="author" content="Ethan Hunt"> <meta name="description" content="This description is shown in search engines below the title"> <title>Web page's title</title> </head> <body> This lesson is about the title and meta elements. </body> </html>
The description meta element is shown in search engine results. So it is important to write a relevant description for the web page for both ranking better in search engines and also for giving potential visitors an idea about the web page.