Basic tags used in head tag
In a html page we all know there is basic tag we need to use which is “Head”. We also call it the header of the webpage, because this tag holds all kind of summary of the webpage. Usually any search engine takes the simple record of a webpage from the header. Only the title tag can be displayed to the users other than the title rest of the information is used only for search engines. Before we start briefly I would like to mention the basic structure of a webpage and then I would like to mention the tags that are used in between head tag.
Basic structure of a webpage:
Basic tags that are usually used in head of a html file.
Title tag defines the title of the webpage. It is required in a html webpage. This name is important for so many reasons. The most important reason here is search engine optimization. Search engines will follow this title tag first to index on the database. Not only that, the search engine will show the page title as a search result.
Style tag is another tag that is usually used in head tag. It is used to apply CSS to design the html tags, classes or ids. As we all know CSS is the style sheet for the design purpose. This is usually applicable in case of static web pages.
Link is another tag that helps us to link another css file to a html file. Instead of writing the CSS codes within the html file we can create another file to write the CSS, and then we can add those files in html.
Meta tag is another important part of head section. It usually used for define data or character set. Meta tag usually defines the character set or the webpage. The option used for this is “charset”. The second option here is “name”. we can define name using four different options.
Description is known as Meta description which is shown when the search engine shows some information about the webpage. This is a very important issue for SEO.
Keywords are basically we need for SEO of the webpage. This is another issue that can help us make our webpage popular.
Author is an optional thing in case of meta tag. It usually shows as an warning if we do not put anything there. But the best practice is to put an author name to every single webpage.
Viewport is a new option here. This is used for making the webpage responsive according to devices.
This tag can be used in anywhere within the html tags. But it is used to include all the scripts at the beginning of the html file. Also as this is a client side script, so it needs to be put at the beginning to be interactive. Yet we can put it anywhere in the html tags.
This tag is used to define a url or a target. This must be put in between the head tags. It is better to have both starting base tag and ending base tag. But we can use it with just starting tag. The url should be put using href parameter.
Noscript is the element where we cannot use scripts. Using this element we can run scripts where either the browsers do not support scripting or somehow the user disabled the script. Within this tag we can use only link, meta and style. So this is only used when it is must to use.