我是靠谱客的博主 可爱凉面,最近开发中收集的这篇文章主要介绍清除(HTML属性),觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

描述 (Description)

The clear attribute is a deprecated (presentational) attribute that’s used to clear any preexisting right or left alignments. It ensures that the content after the br element appears beneath the baseline of the previously aligned element; the br doesn’t just create a line break in the content that’s flowing around the right- or left-aligned element.

clear属性是不推荐使用的(表示性)属性,用于清除任何先前存在的右对齐或左对齐。 它确保br元素之后的内容出现在先前对齐的元素的基线之下; br不仅会在围绕右对齐或左对齐元素的内容中创建换行符。

In the past, this approach would most often have been used to stop content wrapping around a right- or left-aligned image or table.

过去,这种方法最常用于停止围绕右或左对齐的图像或表格进行内容环绕。

The correct way of managing alignment issues is to use the CSS float property, rather than the HTML align attribute. To clear elements, we use the CSS clear property like so:

解决对齐问题的正确方法是使用CSS float属性,而不是HTML align属性。 为了清除元素,我们使用CSS clear属性,如下所示:

<br clear="left"/> the old-fashioned HTML way
<br style="clear:left;"/> the CSS way

Note that you should avoid inline CSS styles—the inline style above is provided for direct comparison purposes only.

请注意,您应该避免使用内联CSS样式-上面的内联样式仅用于直接比较。

(Example)

This example shows a br with which a clear attribute is used to take content below a right-aligned image:

此示例显示了一个br ,使用br时, clear属性用于获取右对齐图像下方的内容:

<p><img src="pool.jpg" alt="sitting by the pool" align="right"/>
The rest of the day was a lazy one, partly spent by the complex
pool, partly inside watching British TV, but we couldn't be doing
this for the rest of the holiday. Already we were missing having
the car!

<br clear="all"/>
I decided to check out what the weather would be doing for the next
few days, as that would help us make any decisions about future
excursions.
</p>

翻译自: https://www.sitepoint.com/clear-html-attribute/

最后

以上就是可爱凉面为你收集整理的清除(HTML属性)的全部内容,希望文章能够帮你解决清除(HTML属性)所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(75)

评论列表共有 0 条评论

立即
投稿
返回
顶部