Compatibility of spaces in different browsers

Source: Internet
Author: User

For IE and Firefox, four spaces equals three spaces.
How do I set a blacklist to be displayed on a webpage? The answer is as follows:
1. In gbk2312 encoding. We can set the directly in CSS. Font-family:;
2. UTF-8. To display the simhei effect. You can set font-family: "simhei ";
Compatibility of various browsers with spaces:
Consecutive spaces & nbsp;) between two words, which are different in IE, ff, and chrome, ff and chrome seem to narrow down. How can this problem be solved?
1. Set the font spacing or set the font to, and then use & nbsp.
2. You only need to enter a space in the full-angle state! Full compatibility!
 
Use a space character in IE and FF but the display effect is different (use & nbsp; but the width is different). The principle is that different browsers have different default fonts, I wrote a test file that is normal under IE and FF, but the display effect is different under Safari. Generally, the default fonts of IE and FF are both, while the default fonts of safari are Times New Roman and are character width fonts, but Times New Roman is not character width fonts, because the default font of the browser is different, the space character & nbsp; has different display widths under different browsers.

Solution: Set the font on the line with spaces and set the font to any Character spacing.
For example: <Div style = "border: 1px # ff0000 solid; font-family: ' '; white-space: Pre;"> & nbsp; okay </div>

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.