简体   繁体   English

文字/ HTML旁边的内容类型

[英]Content type beside text/html

You probably all know the tag: 您可能都知道标签:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

I was wondering what values are there beside text/html for the content attribute? 我想知道content text/html属性旁边的text/html值是什么?

Common ones include: 常见的包括:

  • text/xml 文字/ xml
  • application/json 应用程序/ json
  • image/jpeg 图片/ jpeg

Comprehensive list here : http://www.freeformatter.com/mime-types-list.html#mime-types-list 此处的完整列表: http : //www.freeformatter.com/mime-types-list.html#mime-types-list

The only content type values you'd want to use for HTML are text/html and application/xhtml+xml for XHTML. 您要用于HTML的唯一内容类型值是application/xhtml+xml text/htmlapplication/xhtml+xml

See also: Valid content-type for XML, HTML and XHTML documents 另请参阅: XML,HTML和XHTML文档的有效内容类型

This is the long winded HTML4 way of writing the meta tag. 这是编写meta标签的漫长的HTML4方法。 In HTML5 it's much simpler. 在HTML5中,它要简单得多。

New: 新:

<meta charset="UTF-8">

Since you can technically pass just about any form of data to the web browser the 由于您可以从技术上将几乎任何形式的数据传递到Web浏览器,因此

content="text/html

Was meant to tell the browser that is was going to be displaying text/html. 旨在告诉浏览器将要显示text / html。

Meta tags are used to describe data about the web page. 元标记用于描述有关网页的数据。 The data is not displayed, however it can be used for several things. 数据不会显示,但是可以用于多种用途。 Example supplying and author, giving a description, keywords, and even a document refresh interval. 提供和作者的示例,提供描述,关键字,甚至文档刷新间隔。

HTML meta tag HTML元标记

Also.... 也....

Using Meta Tags in HTML: Some Basics and Best Practices 在HTML中使用元标记:一些基础知识和最佳做法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM