2010-05-20 6 views
8

मेरी वेबसाइट परियोजनाओं के लिए "बुनियादी ढांचा" स्थापित करना, मुझे आश्चर्य है कि मेटा तत्व वास्तव में आवश्यक/अनुशंसित हैं? विशेष रूप से, मैं जानना चाहता हूं कि भाषा विशेषता से कैसे निपटना है !? निम्नलिखित उदाहरण में, मुझे लगता है कि sth। अनावश्यक रूप से दोहराया जाता है ...अनुशंसित मेटा तत्व?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> 

<head> 

<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
<meta http-equiv="content-style-type" content="text/css" /> 
<meta http-equiv="content-script-type" content="text/javascript" /> 
<meta http-equiv="content-language" content="en" /> 
<meta http-equiv="language" content="en" /> 

<title> Title </title> 
<base href="http://www.mydomain.com" /> 

<meta name="charset" content="utf-8" /> 
<meta name="content-language" content="en" /> 
<meta name="language" content="en" /> 

<meta name="description" content="description" /> 
<meta name="keywords" content="keywords" /> 

</head> 

पीएस "सामग्री-भाषा" = "भाषा"?

+0

http://stackoverflow.com/questions/1092329/what की डुप्लिकेट:

<meta http-equiv="content-type" content="text/html; charset=utf-8"/> 

ये आरंभिक हेड टैग के बाद सीधे होना चाहिए: यह अत्यधिक भी पुराने तरीके से शामिल करने के लिए सिफारिश की है -अ-द-महत्वपूर्ण-मेटा-टैग-i-must-put-in-my-website –

उत्तर

14
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 

निश्चित रूप से सिफारिश की

<meta http-equiv="content-style-type" content="text/css" /> 

अनुपयोगी, केवल समर्थन सीएसएस ब्राउज़र।

<meta http-equiv="content-script-type" content="text/javascript" /> 

बेकार, ब्राउज़र केवल जावास्क्रिप्ट का समर्थन करते हैं।

<meta http-equiv="content-language" content="en" /> 

बेमानी <html lang="en">

<meta http-equiv="language" content="en" /> 

मौजूद नहीं है, AFAIK।

<title> Title </title> 

निश्चित रूप से अनुशंसित।

<base href="http://www.mydomain.com" /> 

इस बात पर निर्भर करता है कि आप अपने सापेक्ष लिंक कैसे काम करना चाहते हैं, मुझे लगता है।

<meta name="charset" content="utf-8" /> 
<meta name="content-language" content="en" /> 
<meta name="language" content="en" /> 

टाइपो की तरह दिखें।

<meta name="description" content="description" /> 

शायद उपयोगी।

<meta name="keywords" content="keywords" /> 

व्यापक दुरुपयोग के कारण हर खोज इंजन द्वारा अनदेखा किया गया।

+0

धन्यवाद, ms2ger! – joyce

1

उपयोग इस एचटीएमएल 5 के लिए:

<!DOCTYPE html> 

यह गलत लग रहा है:

<meta name="charset" content="utf-8" /> 

शायद एचटीएमएल 5 के लिए यह होना चाहिए:

<meta charset="utf-8"> 

नए HTML 5 है अक्षरसेट एन्कोडिंग सेट करने का तरीका।

<!DOCTYPE html> 
<html> 
    <head> 
     <meta charset="utf-8"> 
     <meta http-equiv="content-type" content="text/html; charset=utf-8"/> 
     <title>The title</title> 
    </head> 
    <body> 
    </body> 
</html> 
संबंधित मुद्दे