Note: 1.css style, the front add @charset "Utf-8"; why 2.js is the way to judge various browsers

Source: Internet
Author: User
Indicates that the page encoding of the CSS file is UTF-8. If this CSS file encoding is also UTF-8 words. Then in the browser to see the CSS file page in Chinese comments or Chinese fonts can be correctly displayed as Chinese, if the CSS file encoding and page
to the letter. Then this CSS file in Chinese will be displayed as garbled. In particular, when defining Chinese fonts. will not be recognized correctly. Others do not have much impact.

GB2312 coding is suitable for the exchange of information between Chinese character processing and Chinese character communication system, which is used in mainland China and Singapore. Almost all Chinese-language systems and international software in mainland China support GB 2312.
var browser_name=navigator.appname;


JS to judge the various browser methods:

var browser_agent=navigator.useragent;

var is_ie= (browser_name== "Microsoft Internet Explorer");//interpretation is IE browser

if (Is_ie) {

IE browser

}else if (Browser_agent.indexof ("Chrome")!=-1) {

Google Chrome

}else if (Browser_agent.indexof ("Firefox")!=-1) {

Firefox browser

}else if (Browser_agent.indexof ("Opera")!=-1) {

Opera browser

}else if (Browser_agent.indexof ("Safari")!=-1) {

Safari browser

}

Note: 1.css style, the front add @charset "Utf-8"; why 2.js is the way to judge various browsers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.