HTML 折行 <br/>标签
定义和用法:
<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> 标签。
效果图:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head> <body>
<img src="/i/eg_greanfoliage.jpg" />
This text should wrap around the image, flowing between the image and the right margin of the document.
<br />
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.
</body>
</html>
2.带有 align 属性的 <img> 标签与不带有 clear 属性的 <br> 标签
效果图:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head> <body>
<img src="/i/eg_greanfoliage.jpg" align="left" />
This text should wrap around the image, flowing between the image and the right margin of the document.
<br />
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.
</body>
</html>
3.带有 align 属性的 <img> 标签与带有 clear 属性的 <br> 标签。
效果图:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head> <body>
<img src="/i/eg_greanfoliage.jpg" align="left" />
This text should wrap around the image, flowing between the image and the right margin of the document.
<br clear="left" />
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.
</body>
</html>
4.align 属性为 absmiddle 的 <img> 标签与clear 属性为 left 的 <br> 标签。
效果图:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head> <body>
<img src="/i/eg_greanfoliage.jpg" align="absmiddle" />
This text should wrap around the image, flowing between the image and the right margin of the document.
<br clear="left" />
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.
</body>
</html>
HTML 折行 <br/>标签的更多相关文章
- HTML 折行br
HTML 折行 如果您希望在不产生一个新段落的情况下进行换行(新行),请使用 <br /> 标签: <p>This is<br />a para<br /&g ...
- echarts图表标签(axisLabel)折行
在项目中遇到了一个echarts图表标签过长需折行的需求,so引出这篇总结,啦啦啦有帮助就多多支持啦,撒花撒花撒花~~~~ 在此不对echarts其他用法做解释,详细见echarts文档(点击前往) ...
- 使用<br>标签分行显示文本
对于上一小节的例子,我们想让那首诗显示得更美观些,如显示下面效果: 怎么可以让每一句诗词后面加入一个折行呢?那就可以用到<br />标签了,在需要加回车换行的地方加入<br /> ...
- CSS3设置内容超过一定长度后自动折行
在用编辑器保存的数据到数据库的时候经常是在我们的内容前后加一个P标签,但是出来之后是一行,有时候会超过边框的宽度,所以研究了如何折行,如下代码: <!DOCTYPE html> <h ...
- 文字折行不折行 css
white-space : 1. normal 默认值 ,文字自动换行. 2. pre 使用<pre>标签形式,表示元素. * ...
- css块级标签、行内标签、行内块级标签
<html><head lang="en"> <meta charset="UTF-8"> <title>< ...
- css块级标签,行内标签,行内块标签的转换(2)
css块级标签,行内标签,行内块标签的转换 版权声明 本文原创作者:雨点的名字 作者博客地址:https://home.cnblogs.com/u/qdhxhz/ 在基础1中,我详细讲 ...
- span 右浮动折行 解决ie6/7中span右浮动折行问题
A floated box is shifted to the left or right until its outer edge touches the containing block edge ...
- 正则去除字符串中的html标签,但不去除<br>标签
一.去除html标签 filterHTMLTag(msg) { var msg = msg.replace(/<\/?[^>]*>/g, ''); //去除HTML Tag msg ...
随机推荐
- jq html 页面点击图片直接上传
<form id="ff" method="post" enctype="multipart/form-data" style=&qu ...
- First insmod a module
不得不说网上坑爹的文章比虱子还多,参考这位仁兄调试成功 喜欢C的人却靠着Java产业吃饭,人艰不拆... 对于未知的东西,有个习惯,run success first,then research en ...
- grep 常用参数详解
grep常用参数详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 刚刚和同事打完球,虽然自己输了~不过也蛮好玩的,好久没有玩过乒乓球啦,话说你喜欢玩乒乓球吗?好啦,话不多说说,让 ...
- 在Unity中如何取得一个Box的Bounds
private BoxCollider mCollider; // Use this for initialization void Start () { mCollider = GetCompone ...
- Bootstrap 响应式设计
本教程讲解如何在网页布局中应用响应式设计.在课程中,您将学到响应式 Web 设计.随着移动设备的普及,如何让用户通过移动设备浏览您的网站获得良好的视觉效果,已经是一个不可避免的问题了.响应式 Web ...
- -XX:-PrintClassHistogram 按下Ctrl+Break后,打印类的信息
-XX:+PrintClassHistogram –按下Ctrl+Break后,打印类的信息: num #instances #bytes class name ------ ...
- The method setCharacterEncoding(String) is undefined for the type HttpServletResponse 是什么原因?
response.setCharacterEncoding("gb2312"); 在Servlet2.3中是不行的,至少要2.4版本才可以,如果低于2.4版本,可以用如下办法: r ...
- curl_init函数用法
使用PHP的cURL库可以简单和有效地去抓网页.你只需要运行一个脚本,然后分析一下你所抓取的网 页,然后就可以以程序的方式得到你想要的数据了.无论是你想从从一个链接上取部分数据,或是取一个XML文件并 ...
- 使用 greenDao 框架 操作数据库
0.效果图
- [转]使用xcode4 workspace 多个project协同工作
转载地址:http://erlangprogram.com/use-xcode4-workspace 一般的某个应用单独新建一个 project 就可以了,然后把所有的程序文件都放在里面,这个可以 ...