html css
2016-01-11 09:06
519 查看
1.HTML超出文本显示省略号…[text-overflow]
需要对div或者span同时应用Css:
引用自:http://blog.csdn.net/jcx5083761/article/details/8538071
多行溢出的处理:
自动高度
只显示右侧滚动条:
“口”;
“√”;
解決方法:
1、再父级标签上也就是加了边框的这个标签设定overflow:hidden;
2、给父级标签也加上float: left;
3、如果内容部分的标签高度不会再变化的话,那么算准内部标签的高度后,再直接给父级设定高度就好了。
需要对div或者span同时应用Css:
-o-text-overflow:ellipsis; text-overflow:ellipsis; white-space:nowrap; overflow:hidden;
引用自:http://blog.csdn.net/jcx5083761/article/details/8538071
多行溢出的处理:
.overflowTwoLine{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient: vertical; }
自动高度
<!DOCTYPE HTML> <html lang="en"> <head> <meta charset="UTF-8"> <title>自动高度</title> <style type="text/css"> .container{ background-color: silver; width:100%; position:relative; overflow:hidden; } .dummy{ margin-top: 75%; } .content{ position:absolute; left:0; right:0; top:0; bottom: 0; } </style> </head> <body> <div style="width:50%;"> <div class='container'> <div class='dummy'></div> <div class='content'> contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent contentcontentcontentcontentcontentcontentcontentcontent </div> </div> </div> </body> </html>
只显示右侧滚动条:
.table-wrapper { overflow-x:hidden; overflow-y: scroll; } <div class="table-wrapper"> </div>
符號
“☑”;“口”;
“√”;
#
两个都是设置的左浮动,为什么DIV边框不见了?解決方法:
1、再父级标签上也就是加了边框的这个标签设定overflow:hidden;
2、给父级标签也加上float: left;
3、如果内容部分的标签高度不会再变化的话,那么算准内部标签的高度后,再直接给父级设定高度就好了。
相关文章推荐
- 【B-S】牛腩——使用CSS美化网页
- dialog样式的activity点击外层,activity消失
- 针对ie8的css hack
- CSS中父div与子div——子div有内容,父div高度却为0?
- css实现在div中垂直水平居中
- Web--CSS控制页面(link与import方式差别)
- CSS3学习笔记(4)-CSS3函数
- CSS页面控制方式及其优先级-- 行内样式、内嵌式、链接式、导入式
- CSS3后代选择器和同级选择器简介和实例
- 通过字符串、颜色和尺寸资源改变文字及样式
- 获取document对象除了getElement方法,居然还可以使用css选择器方法!!!
- CSS权威指南学习笔记(1)
- 简易在线投票系统(php)——前端设计(css)
- 利用css3伪类实现边框环绕效果
- css3制作立体导航
- 【CSS3】CSS3 滤镜实现
- 燕十八视频--CSS
- 燕十八---CSS画三角形
- css3实现图片旋转效果
- css中margin、padding等属性的简写方式解读