Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML <head> best practices [closed]

Tags:

There are <meta> tags and other things you can place in the <head> of your HTML document. What <meta> tags etc. and best practices do you make use of in your HTML document to make it more accessible, searchable, optimized etc.

like image 205
Luke Avatar asked Nov 09 '08 05:11

Luke


People also ask

Do you close head in HTML?

head is required and it should be used just once. It should start immediately after the opening html tag and end directly before the opening body tag.

When should head be used in HTML?

The <head> tag in HTML is used to define the head portion of the document which contains information related to the document. The <head> tag contains other head elements such as <title>, <meta>, <link>, <style> <link> etc. In HTML 4.01 the <head> element was mandatory but in HTML5, the <head> element can be omitted.

What should my head be HTML?

In an HTML file, the html head is the first section in the code containing information about a web page's properties and links to external related files. For example, in the HTML head, you can have the title of the page, meta tags, CSS code, Open Graph tags, and JavaScript code.

What is the closing tag for head?

To create a header for a HTML document, we use the header tag. The opening header tag is <HEAD> and the closing header tag is </HEAD>.


2 Answers

In my case:

  • Title (should do [Section Name - Site Name] for better SEO)
  • Meta tag for Content-type, description, and keywords
  • Link to stylesheet(s) (don't forget to specify the media="").
  • <script> tag that links to external javascript files.

All tags should follow the W3C's standard. The W3C site has a more technical and detailed section about the HTML <head> section.

like image 196
andyk Avatar answered Sep 19 '22 22:09

andyk


Do your users a favor and make their IE engine switch to Chrome one when Chrome Frame is installed :)

<meta http-equiv="X-UA-Compatible" content="chrome=1"> 
like image 43
kangax Avatar answered Sep 18 '22 22:09

kangax