texmith website exit icon
Press enter to confirm search term
texmith, it support, ui ux design, web development
HTML

HTML Head

Texmith website arrow icon

 

HTML Head is a container for all the head elements. Head elements are not displayed on the the web page. The <head> element accommodates. All the HTML Head elements will come between <head> opening tag and its </head> closing tag. HTML Head consists the following elements,

§  <Title>

§  <script>

§  <noscript>

§  <link>

§  <Style>

§  <base>

§  <meta>

HTML Head   <title>

The <title> tag is the most common tag know in the HTML Head section. It is the title of the document. It defines the title on the web page. The title will describe and define the main web page content. Title tags are displayed on the top bar of the browser. Like others, title as well has an opening and closing tag.


<head>
         <title> This is the title of the page </title>
</head>

  

HTML Head   <script>

<Script> tag helps you if you want to make your HTML page content more vigorous. <Script> tag actually comes from the word Java Script. Java script personalizes a web page and the content in it, <script> tag helps you connect Java Script with HTML. Through this script your HTML page would know that you’re trying to add a different language in it.


<head>
<script>Type=”text/javascript”
         </script>
</head>

 


HTML Head   <noscript>

The HTML <noscript> tag defines alternate HTML to be inserted if a scrip type is not supported or if the browser has disabled scripting. This tag is used to display an alternate text message. The <noscript> element defines a message that is displayed if the browser does not support a defined script. <noscript> tag can also work in <body> tag.


<head>
         <script Type=”text/javascript”>
              <!--
                    document .write(“Hello JavaScript”)
               -->
         </script>
        <noscript>
                  Your browser does not support JavaScript!
        </noscript>
</head>

 

HTML Head   <link>

The <link> tag is used to link external stylesheets. Link tag will go in the <head> section every time. It has no end tag.


<head>
       <link rel=”stylesheet” type=”text/css” href=”theme.css”>
</head>

You have to change the name “theme.css” to the name of stylesheet that you’ve named in your page.

 

HTML Head   <style>

The <style> tag is used as an internal stylesheet in the head section of HTML. Inside the style element you command the page to render your CSS with your HTML document. Each HTML document can have multiple <style> tags.

 

 
<html>
<head>
        <style>
         h1 {color: blue;}
         p {color: red;}
</style>
</head>
<body>
        <h1>This is a heading</h1>
        <p>This is a paragraph</p>
</body>
</html>

 

HTML Head   <base>

The HTML base element establishes the base URL for all relative URL’s in a HTML document. There can only be one <base> tag in a HTML document, <base> tag will always be in the head section. It must have a target attribute or an href attribute or both. The <base> tag has no end tag.

 

<base href=”http://www.example.com/page.html”>
<base target=”_blank” href”=http://www.example.com/page”>

 

HTML Head   <meta>

The <meta> tag provides meta data of the HTML document. It specifies the page description, keywords, last modifies, generator, name of the author and other additional information about the document. You can have one or more <meta> tags in your HTML document.

The meta data provides the property values. Meta data can be used to specify web pages, search engines or other web services. It is not displayed on the web page but for machine reading and registering the data.

 

<head>
        <meta name=”description” content=”HTML Head Tutorial>
        <meta name=”keywords” content=”HTML, CSS, link, meta”>
        <meta name=”author” content=”Navneet Kaur”>
</head>

Interested in working with Us? Drop us a line!