当前位置: 首页 > news >正文

网站建设吉金手指排名13临夏市做网站电话

网站建设吉金手指排名13,临夏市做网站电话,望野古诗王绩,贵阳网站设计模板在CSS中#xff0c;我们可以通过下面的样式实现DIV元素中文本超长后自动截断并以省略号结尾#xff1a; overflow: hidden;word-break: normal;text-overflow: ellipsis; text-overflow: ellipsis是实现文本截断后以省略号结尾的关键样式#xff0c;但问题是如果添加该样式则…  在CSS中我们可以通过下面的样式实现DIV元素中文本超长后自动截断并以省略号结尾 overflow: hidden; word-break: normal; text-overflow: ellipsis; text-overflow: ellipsis是实现文本截断后以省略号结尾的关键样式但问题是如果添加该样式则DIV元素内的文本无法自动换行也就是说该效果只被允许在单行文本上实现。另外word-break: normal可以防止文字被部分截断这个在内容为英文的情况下显得尤其重要。 要实现多行文本自动截断以省略号结尾的效果通常的做法是使用JavaScript脚本。下面这些文章给出了如何通过脚本进行字符串截断不过仅限于英文环境。 http://www.barelyfitz.com/projects/truncate/ http://www.javascriptsource.com/miscellaneous/truncate-text.html http://www.javascriptbank.com/truncate-html-text.html/en/ 使用纯CSS样式来实现该效果则会稍微有些麻烦你需要懂得如何在CSS中进行hack。这里是一个可以在多个通用浏览器中实现该效果的例子: !DOCTYPE HTML html head style html, body, p { margin: 0; padding: 0; font-family: sans-serif;} .ellipsis { overflow: hidden; height: 200px; line-height: 25px; margin: 20px; border: 5px solid #AAA; } .ellipsis:before { content:; float: left; width: 5px; height: 200px; } .ellipsis *:first-child { float: right; width: 100%; margin-left: -5px; } .ellipsis:after { content: \02026; box-sizing: content-box; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; float: right; position: relative; top: -25px; left: 100%; width: 3em; margin-left: -3em; padding-right: 5px; text-align: right; background: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(white), color-stop(50%, white)); background: -moz-linear-gradient(to right, rgba(255, 255, 255, 0), white 50%, white); background: -o-linear-gradient(to right, rgba(255, 255, 255, 0), white 50%, white); background: -ms-linear-gradient(to right, rgba(255, 255, 255, 0), white 50%, white); background: linear-gradient(to right, rgba(255, 255, 255, 0), white 50%, white); } /style /head body div classellipsisdiv pCall me Ishmael. Some years ago ndash; never mind how long precisely ndash; having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen, and regulating the circulation. Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet; and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent me from deliberately stepping into the street, and methodically knocking peoples hats off ndash; then, I account it high time to get to sea as soon as I can./p /div/div /body /html 通过修改.ellipsis和.ellipsis:before样式中height属性的值来指定容器的高度。该样式的实现在多个不同版本的浏览器下测试通过注意如果你是在IE下查看则需要确保你的文档模型必须是在标准模式下即Document Mode必须是Standards。 这里是原文出处CSS Ellipsis: How to Manage Multi-Lice Ellipsis in Pure CSS 更多专业前端知识请上 【猿2048】www.mk2048.com
http://www.yutouwan.com/news/408178/

相关文章:

  • vs 2008 手机网站开发鹤壁做网站哪家便宜
  • 丰镇市网站丰镇高铁在哪个位置建设动感技术网站建设
  • 禹城建设局网站wordpress poetry
  • 电商网站的模式网站建设评价
  • 做直播网站软件有哪些软件下载网页版梦幻西游官网
  • 顺德装修网站建设网站的 规划与建设
  • 乌托邦网站建设网站的建设与运营
  • 重庆网站建设子沃科技wordpress 视频外链
  • 汽车行业网站建设比较好门店到什么地步可以做网站
  • 岳阳新网网站建设有限公司建立文档
  • 做图片详情网站青岛公司logo设计
  • 去哪里建设自己的网站?高端手机网站
  • 网站建设进度计划表有哪些做外贸的网站
  • 官方网站建设优化从零开始自己做外贸网站和海外网络营销
  • 重庆建设技术发展中心网站企业网络营销案例分析
  • php网站怎么做301跳转工程网站开发
  • 响应式网站开发用什么软件网络规划设计师和系统架构设计师
  • 网站开发实战演练保险网站排名
  • 上海网站制作广州网站制作公司电话
  • 网站广告推广技巧分享广东网站建设找
  • 网站套餐到期啥意思定西市小企业网站建设建设
  • 教学资源网站建设设计中国世界排名前200的大学名单
  • 新类型的网站推广渠道方案
  • 杭州公司的网站建设公司阿里巴巴网站如何做免费推广
  • 塘沽做网站比较好的珠海建网站多少钱
  • lamp网站开发经验wordpress 固定链接结构出错
  • 男女直接做那个视频网站网页设计教程书籍推荐
  • 做网站工作描述网站做平台有哪些
  • 辽宁市营商环境建设局网站wordpress图片主题演示
  • 安徽区块链虚拟币网站开发价格网站服务器内网打不开网页