Is Content-Type meta tag important if responce headers include content-type?
At the moment we set content-type in our responce headers, a bit like this...
Content-Type text/html; charset=utf-8
We also have this at the top of html pages...
<!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">
<head>
<meta http-equ开发者_如何学编程iv="Content-Type" content="text/html; charset=utf-8" />
I've left the rest of the page out.
I know that we don't strictly speaking need the meta tag at the top of the html page.
However, do I need to leave it there really, due to known browser bugginess / problems etc? I'd like to take it out to avoid character encoding being set in 2 different places, but need to be sure it won't mess anything up somewhere.
Including or removing the meta tag won't make any difference when the page is served from your site.
But if a user saves the page to disc, the Content-Type metadata will be lost. So continue to include the meta tag if you anticipate users saving your page.
精彩评论