您好,欢迎访问一九零五行业门户网

css自动换行怎么设置

css自动换行的设置方法:使用【word-break】属性,可以让浏览器实现在任意位置换行,代码为【.p3{width:200px;border:1px solid #ccc;word-break:break-all】。
本教程操作环境:windows7系统、css3&&html5版,dell g3电脑。
css自动换行的设置方法:
自动换行属性,使用word-break属性,可以让浏览器实现在任意位置换行
它有三个属性值分别为:
normal: 浏览器中的默认换行行为
break-all:可允许在单词内换行
keep-all:只能在半角空格或连字符处进行换行
示例:
<style>.p1{width:200px;border:1px solid #ccc;word-break:normal;} .p2{width:200px;border:1px solid #ccc;word-break:keep-all;} .p3{width:200px;border:1px solid #ccc;word-break:break-all;}</style></head><body><p class="p1">php chinese website provides a large number of free, original, high-definition php video tutorials.</p><p class="p2">php chinese website provides a large &nbsp;number of free, original, high-definition php video tutorials.</p><p class="p3">php chinese website provides a large number of free, original, high-definition php video tutorials.</p></body>
效果图:
相关教程推荐:css视频教程
以上就是css自动换行怎么设置的详细内容。
其它类似信息

推荐信息