css中文英文换行、禁止换行、显示省略号
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了css中文英文换行、禁止换行、显示省略号,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2567字,纯文字阅读大概需要4分钟。
内容图文
css中文英文换行
1
word-break:break-all;只对英文起作用,以字母作为换行依据
2
word-wrap:break-word; 只对英文起作用,以单词作为换行依据
3
white-space:pre-wrap; 只对中文起作用,强制换行
4
white-space:nowrap; 强制不换行,都起作用
5
white-space:nowrap; overflow:hidden; text-overflow:ellipsis;不换行,超出部分隐藏且以省略号形式出现
css 省略号
.text2 {
width:200px;
word-break:break-all;
display:-webkit-box;
-webkit-line-clamp:2;
-webkit-box-orient:vertical;
overflow:hidden;
}
img 图片盒子内垂直水平居中
.offer_img {
height: 100%;
width: 100%;
text-align: center;
vertical-align: middle;
padding: 0.2rem;
img{
max-width: 100%;
max-height: 100%;
display: inline;
}
}
.offer_img:after {
content: "";
display: inline-block;
height: 100%;
vertical-align: middle;
width: 0;
}
清除浮动
.clearfix:before, .clearfix:after, {
content: "";
display: table; }
.clearfix:after {
clear: both; }
.clearfix {
*zoom: 1; }
css 初始化reset.css
/*
*
* Eric Meyer‘s Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)
* http://cssreset.com
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header,
menu, nav, output, ruby, section, summary,
time, mark, audio, video, input {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font-weight: normal;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/* custom */
a {
color: #7e8c8d;
text-decoration: none;
-webkit-backface-visibility: hidden;
}
li {
list-style: none;
}
::-webkit-scrollbar {
width: 5px;
height: 5px;
}
::-webkit-scrollbar-track-piece {
background-color: rgba(0, 0, 0, 0.2);
-webkit-border-radius: 6px;
}
::-webkit-scrollbar-thumb:vertical {
height: 5px;
background-color: rgba(125, 125, 125, 0.7);
-webkit-border-radius: 6px;
}
::-webkit-scrollbar-thumb:horizontal {
width: 5px;
background-color: rgba(125, 125, 125, 0.7);
-webkit-border-radius: 6px;
}
html, body {
width: 100%;
}
body {
-webkit-text-size-adjust: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
原文:http://www.cnblogs.com/JennyGao/p/7016745.html
内容总结
以上是互联网集市为您收集整理的css中文英文换行、禁止换行、显示省略号全部内容,希望文章能够帮你解决css中文英文换行、禁止换行、显示省略号所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。