This is an important element, between its opening and closing tags comes things like "metadata" and "title." It is useful, as it links "stylesheet" and "javascript" files to the webpage. Apart from linking "stylesheet," CSS could be written between <style> and </style> in the "head" element.
It also tells search engine what to prefer in terms of "canonical" url, "keywords"; and browsers what to do in terms of meta "viewport." There are many other things that fall in <meta> and <link>, which you may understand by examining a site's source code.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Learning about Head element </title>
<meta name="keywords" content=" some keywords">
<link rel="canonical" href="url type you prefer">
<link href="style.css" rel="stylesheet">
<style>
body {background-color:#ddd;}
</style>
<script src="script.js"></script>
</head>
<body>
</body>
</html>
Comments
Post a Comment