What is  ? Is it needed?

  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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值