博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HTML 折行 <br/>标签
阅读量:4589 次
发布时间:2019-06-09

本文共 1902 字,大约阅读时间需要 6 分钟。

定义和用法:

<br/>可插入一个简单的换行符。

  • br标签是单独出现的,<br />
  • 当使用br标签时,其后面的所有内容都将在下一行出现
  • 属性
    • Common -- 一般属性
    • clear -- 换行输出方式

提示和注释:

注释:请使用 <br> 来输入空行,而不是分割段落。

<br> 标签的 clear 属性:

通常情况下,<br> 标签会告诉浏览器立即停止当前的文本流,并在下一行的左边,或者在左对齐的内联图形或表格的右边开始继续输出文本流。

但是有时候,您也许希望当前的文本流在当前左边或右边的内联表格或图像的下面一行继续输出。

HTML 4 和 XHTML 通过 <br> 标签提供了这样的功能。它可以具有三个值:left、right 或者 all,每个值都代表一个边界或两边的边界。当指定的边界没有图像时,浏览器才会继续输出文本。

提示和注释

提示:一般情况下,文本流中的其他行会在内联图像的底部显示,除非图形的 <img> 标签被设置为左对齐或右对齐(对于 <table> 标签也一样)。因此,<br> 标签的 clear 属性只对这些左对齐或右对齐的图像或表格起作用。

例子:

1.不带有 align 属性的 <img> 标签与带有 clear 属性的 <br> 标签。

效果图:

This text should wrap around the image, flowing between the image and the right margin of the document.
This text will flow as well, but will be below the image, extending across the full width of the page. there will be whitespace above this text and to the right of the image.

 2.带有 align 属性的 <img> 标签与不带有 clear 属性的 <br> 标签

效果图:

This text should wrap around the image, flowing between the image and the right margin of the document.
This text will flow as well, but will be below the image, extending across the full width of the page. there will be whitespace above this text and to the right of the image.

3.带有 align 属性的 <img> 标签与带有 clear 属性的 <br> 标签。

效果图:

This text should wrap around the image, flowing between the image and the right margin of the document.
This text will flow as well, but will be below the image, extending across the full width of the page. there will be whitespace above this text and to the right of the image.

4.align 属性为 absmiddle 的 <img> 标签与clear 属性为 left 的 <br> 标签。

效果图:

This text should wrap around the image, flowing between the image and the right margin of the document.
This text will flow as well, but will be below the image, extending across the full width of the page. there will be whitespace above this text and to the right of the image.

 

转载于:https://www.cnblogs.com/zuihongyan/p/5640790.html

你可能感兴趣的文章
Java选择结构和数组
查看>>
14、通过jpa往数据库插数据
查看>>
2019牛客多校第二场E MAZE(线段树 + 矩阵)题解
查看>>
嵌套循环及例题
查看>>
c++ 使用WinHTTP实现文件下载功能
查看>>
一个分发复制+mirror的bug
查看>>
LeetCode 520 Detect Capital
查看>>
完全教程 Aircrack-ng破解WEP、WPA-PSK加密利器[zz]
查看>>
什么是C#
查看>>
从云计算到容器到容器云
查看>>
shell 分支/循环
查看>>
api服务端接口安全
查看>>
python中的time模块
查看>>
MyBatis-Plus的简单使用
查看>>
C++学习笔记-标准库类型-Vector类型
查看>>
Oracle 树操作(select…start with…connect by…prior)
查看>>
python中的operator.itemgetter函数
查看>>
h5新特性--- 多媒体元素
查看>>
jQuery实现发送短信验证码后60秒倒计时
查看>>
【CSS】盒模型+选择器(你选择的要操作的对象)
查看>>