html和css基础超过范围的变成省略号
2011-05-09 07:07
447 查看
这事还得从浏览器的兼容性来说,我写的网页文件在chrome下面显示正常,但是在ie9.0下显示不正常,症状就是不能正常变成省略号。这可如何是好,ie6.0本来就够闹心的了,这个iE9.0也不让人省心,该咋办呢。看我的代码吧。
ie9.0下显示:
控制代码是:
更改之后:
。
ie9.0下显示:
控制代码是:
css: .cbox ul li a{ text-decoration:none;!important; color:#333; float:left; width:210px; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom:#999 dotted thin; }
html: <ul> <li><a href="#" mce_href="#"><span style="float:right;" mce_style="float:right;">2011-5-8</span>海青科技在做学校网站海青科技在做学校网站</a></li> <li><a href="#" mce_href="#"><span style="float:right;" mce_style="float:right;">2011-5-8</span>海青科技在做学校网站海青科技在做学校网站</a></li> <li><a href="#" mce_href="#"><span style="float:right;" mce_style="float:right;">2011-5-8</span>海青科技</a></li> <li><a href="#" mce_href="#"><span style="float:right;" mce_style="float:right;">2011-5-8</span>海青科技在做学校网站海青科技在做学校网站</a></li> <li><a href="#" mce_href="#"><span style="float:right;" mce_style="float:right;">2011-5-8</span>海青科技在做学校网站海青科技在做学校网站</a></li> <li><a href="#" mce_href="#"><span style="float:right;" mce_style="float:right;">2011-5-8</span>海青科技在做学校网站海青科技在做学校网站</a></li> </ul>
更改之后:
css: .ellipsis{ white-space:nowrap; text-overflow:ellipsis; overflow:hidden; width:140px; display:block; } html>body .ellipsis { clear:none; } html>body .ellipsis:after { content: "..."; } html>body .ellipsis{ max-width:140px; width:auto !important; float:left; } ul{list-style:none;}
html: <ul> <li><a href="#" mce_href="#"><span style="float:right;" mce_style="float:right;">2011-5-8</span><span class="ellipsis">海青科技在做学校网站海青科技在做学校网站</span></a></li> <li><a href="#" mce_href="#"><span style="float:right;" mce_style="float:right;">2011-5-8</span><span class="ellipsis">海青科技在做学校网站海青科技在做学校网站</span></a></li> <li><a href="#" mce_href="#"><span style="float:right;" mce_style="float:right;">2011-5-8</span><span class="ellipsis">海青科技在做学校网站海青科技在做学校网站</span></a></li> <li><a href="#" mce_href="#"><span style="float:right;" mce_style="float:right;">2011-5-8</span><span class="ellipsis">海青科技在做学校网站海青科技在做学校网站</span></a></li> <li><a href="#" mce_href="#"><span style="float:right;" mce_style="float:right;">2011-5-8</span><span class="ellipsis">海青科技在做学校网站海青科技在做学校网站</span></a></li> <li><a href="#" mce_href="#"><span style="float:right;" mce_style="float:right;">2011-5-8</span><span class="ellipsis">海青科技在做学校网站海青科技在做学校网站</span></a></li> </ul>
。
相关文章推荐
- html和css基础超过范围的变成省略号
- css里a标签所有内容都是超过一定宽度后隐藏并且变成省略号 。
- 用CSS和HTML标签来截取过长的文字部分变成省略号
- 用CSS和HTML标签来截取过长的文字部分变成省略号
- 发现css超过字数就用省略号代替的一个属性
- HTML+CSS基础
- JavaWeb入门(五)-HTML-CSS-Javascript基础
- 在慕课学习HTML与CSS基础课程的一些笔记
- 前端零基础入门(三):HTML,CSS,Javascript三者之间的关系
- 在慕课上学习的,HTML和CSS基础学习笔记9
- HTML内超过多少像素以省略号显示
- HTML&CSS基础学习笔记1.22-文章布局
- css注释和html注释用法及应用范围介绍
- CSS控制文本的长度 超过一行显示省略号的实现方法
- HTML与CSS基础之伪元素(五)
- php面试题之一——HTML+CSS(基础部分)
- html css基础(一)
- HTML CSS基础(三)
- 【慕课网】php工程师学习计划之我的学习笔记——01 入门必学web基础 htmlcss基础课程 篇
- HTML+CSS纯干货就业前基础到精通系统学习2016/9/3