css自动换行怎么设置
时间:2022-02-11 16:36
css自动换行的设置方法:使用【word-break】属性,可以让浏览器实现在任意位置换行,代码为【.p3{width:200px;border:1px solid #ccc;word-break:break-all】。 本教程操作环境:windows7系统、css3版,DELL G3电脑,该方法适用于所有品牌电脑。 css自动换行的设置方法: 自动换行属性,使用 它有三个属性值分别为: 示例: 效果图: 相关教程推荐:CSS视频教程 以上就是css自动换行怎么设置的详细内容,更多请关注gxlsystem.com其它相关文章!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 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>