What is  ? Is it needed?
2007-01-14 10:10
218 查看
Short Answer is the entity used to represent a non-breaking space. It is essentially a standard space, the primary difference being that a browser should not break (or wrap) a line of text at the point that this occupies. Long Answer is the entity used to represent a non-breaking space. It is essentially a standard space, the primary difference being that a browser should not break (or wrap) a line of text at the point that this occupies. Many WYSIWYG HTML editors insert these entities in an effort to control the layout of the HTML document. For example, such an editor may use a series of non-breaking spaces to indent a paragraph like this:
This first line of text is supposed to be indented. However, many browsers will not render it as intended.
As the example mentions, some browsers will not, in fact, indent the text because of how that particular browser handles the entity. Some browsers collapse multiple, concurrent non-breaking spaces into a single space. This sometimes happens, even if there are regular spaces separating the consecutive entities. So keep in mind that this "technique" can not be relied on. There are some times when it is "acceptable" or "advisable" to use the entity so long as the consequences are understood: It's intended use of creating a space between words or elements that should not be broken. The only problems that can be associated with this use is that too many words strung together with non-breaking spaces may require some graphical browsers to show horizontal scrollbars or cause them to display the text overlapping table borders. If you need to have an empty table cell, it is often advised that you add a non-breaking space like . This is because some versions of Netscape seem to have problems with completely empty table cells. Indentation. It is generally discouraged to use a non-breaking space, or a series of non-breaking spaces to "force" an indentation. This practice is discouraged for two primary reasons. First, not all browsers handle the entity properly and may in fact ignore it when rendering the document. Second, the practice of trying to "force" a specific presentation is often frowned upon as it tends to fail and/or makes it more difficult for some readers whose browsers may be configured differently from your own.
This first line of text is supposed to be indented. However, many browsers will not render it as intended.
As the example mentions, some browsers will not, in fact, indent the text because of how that particular browser handles the entity. Some browsers collapse multiple, concurrent non-breaking spaces into a single space. This sometimes happens, even if there are regular spaces separating the consecutive entities. So keep in mind that this "technique" can not be relied on. There are some times when it is "acceptable" or "advisable" to use the entity so long as the consequences are understood: It's intended use of creating a space between words or elements that should not be broken. The only problems that can be associated with this use is that too many words strung together with non-breaking spaces may require some graphical browsers to show horizontal scrollbars or cause them to display the text overlapping table borders. If you need to have an empty table cell, it is often advised that you add a non-breaking space like . This is because some versions of Netscape seem to have problems with completely empty table cells. Indentation. It is generally discouraged to use a non-breaking space, or a series of non-breaking spaces to "force" an indentation. This practice is discouraged for two primary reasons. First, not all browsers handle the entity properly and may in fact ignore it when rendering the document. Second, the practice of trying to "force" a specific presentation is often frowned upon as it tends to fail and/or makes it more difficult for some readers whose browsers may be configured differently from your own.
相关文章推荐
- What is ? Is it needed?
- yum提示another app is currently holding the yum lock;waiting for it to exit
- what’s a virtual destructor and when is it needed?
- RMAN-08137: WARNING: archive log not deleted as it is still needed
- poj 1308 Is It A Tree?(并查集)
- What is the GlobalSuppressions.cs/GlobalSuppressions.vb file and why is it needed
- add cool toolbar 256corler is easy,only two file and onCreate func is needed also the MainFrame.toolbar must resize to what real need and also the load width is same to it.
- It is never too late to make a c…
- Is it right?
- composer install 时,提示:Package yiisoft/yii2-codeception is abandoned, you should avoid using it. Use codeception/codeception instead.的解决
- yum提示another app is currently holding the yum lock;waiting for it to exit
- 解决redis连接错误:MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persi
- App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. 解决方案
- 在轻松学习中成长 成功实现高效IT…
- The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build pat
- Definition of 'SAMKeychain' must be imported from module 'SAMKeychain.SAMKeychain' before it is requ
- [转贴]What is Google Binary Search and Should We Fear it?
- ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot exec
- hdu_1325 Is It A Tree?
- Is It A Tree?