HTML Head
The HTML <head>
element is a container for the following elements:
<title>
, <style>
, <meta>
, <link>
, <script>
, and <base>
.
HTML <head>
element
The <head>
element is placed between the <html>
tag and the <body>
tag.
Html head
<html>
<head>
</head>
<body>
</body>
</html>
HTML <title>
element
The <title>
element defines the title of the document. The title must be text-only, and it is shown in the browser's title bar or in the page's tab.
Html title
<html>
<head>
<title> document </title>
</head>
<body>
The content of the website here...
</body>
</html>
HTML <style>
element
The <style>
element is used to define style information for a single HTML page:
Html style
<style>
body { background-color: white; }
a { color: blue; }
div { margin: 10px; }
</style>
HTML <link>
element
The <link>
element defines the relationship between the current document and an external resource.
Html link
<link rel="stylesheet" href="style.css">
HTML <meta>
element
The <meta>
element is typically used to specify the character set, page description, keywords, author of the document, and viewport settings.
The metadata will not be displayed on the page, but are used by browsers (how to display content or reload page), by search engines (keywords), and other web services.
The character set
<meta charset="UTF-8">
The keywords for search engines
<meta name="keywords" content="HTML, CSS, Javascript">
The description of your web page
<meta name="description" content="HTML documentation">
The author of page
<meta name="author" content="author name">
Refresh document every 30 seconds
<meta http-equiv="refresh" content="30">
Setting the viewport to make your website look good on all device
<meta name="viewport" content="width=device-width, initial-scale=1.0">
HTML <script>
element
The <script>
element is used to define client-side JavaScripts.
Html style
<script>
function myFunction(){
document.getElementById("demo").innerHTML = "Hello Javascript!";
}
</script>
HTML <base>
element
The <base>
element specifies the base URL and/or target for all relative URLs in a page.
There can only be one single <base>
element in a document!
Html style
<head>
< base href"https://mockstacks.com/website-output/" target_blank >
</head>