The <head> Element mostly contains content which provides information about the document. Outside the <title> Element, which appears as the webpage name in the tab, the content within <head> is not visible on the page.
<title> ... </title>
The title Element creates the title of a webpage. It will display at the top of the browser, or in the currently open tab.
- The <title> Element does not have any Attributes.
<title>This is the Title of the Webpage</title>
<link />
The link is used to link to an external CSS link. Multiple pages can be linked to the same CSS. This is frequently used if you want to have a single CSS file which can modify the appearance of multiple pages on the website.
- Attribute: rel="stylesheet"
- Attribute: href
- Example: <link rel="stylesheet" href="file.css" />
- Both of these Attributes are required for the Link Element. rel="stylesheet" specifies that it is linking to an external style sheet, while the address of the CSS file (file.css in this example) links to the CSS which will be used.
- Attribute: type="text/css"
- Example: <link rel="stylesheet" type="text/css" href="file.css" />
- The Type Attribute specifies that this is specifically a CSS file.
<link rel="stylesheet" type="text/css" href="file.css" />
<style> ... </style>
STYLE is used to include CSS style markup within a single webpage. It is formatted in CSS, rather than in HTML format. It only applies to the HTML page that it is on, and so does not apply to other websites.
<style> body { background-color: #FFFFFF; } </style>