欢迎来到258分享网,纯净的网络源码分享基地!

258资源分享网

全部作品
全部作品
网站源码
微信源码
素材特效
源码插件
视频教程
建站学院
热门搜索: 织梦  农业种植  农业  安全设置  官方
258资源分享 > 建站学院 > 织梦教程 > DedeCMS标题1行2列,字数智能控制,碎片新闻

推荐下载

HTML5响应式自适应网咯设计

2020-05-12   浏览:740

高端HTML5响应式企业通用网

2020-05-06   浏览:521

html5响应式外贸网站英文版

2020-05-08   浏览:510

HTML5自适应律师工作室类网

2020-04-04   浏览:504

HTML5影视传媒文化公司类网

2020-05-12   浏览:502

DedeCMS标题1行2列,字数智能控制,碎片新闻

发布时间:2020-04-20  

DedeCMS 调用一行2列字数智能控制方法 

本代码基于DedeCMS开发。 
使用时请注意: 
titlelen请大于整个li标签内的一半字符最好大于4-6个; 
如果感觉显示效果不好或出错可以用短标题来做出调整; 
 

调用代码:

Copy to ClipboardLiehuo.Net Codes引用的内容:[] {dede:arclist row='4' titlelen='20' } [field:global name=autoindex runphp="yes"](@me % 2 == 0)?@me="":@me="<li>·";[/field:global]<a href=http://www.dede58.com/a/dedejq/"[field:arcurl/]" target='_blank'>[field:array runphp='yes'] if (@me['shorttitle']=='') @me=@me['title'];else @me=@me['shorttitle'];[/field:array] </a>[field:global name=autoindex runphp="yes"](@me % 2 == 0)?@me="</li> ":@me="";[/field:global] {/dede:arclist}  

效果演示:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <html xmlns=""> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>dede调用一行2列字数智能控制方法</title> <style type="text/css"> <!-- body { margin: 0px; padding: 0px; } #cs { width: 200px; font-size: 12px; list-style-type: none; padding: 10px; background-color: #f5f5f5; border: 1px solid #c1c1c1; margin-top: 40px; margin-right: auto; margin-bottom: 40px; margin-left: auto; } #cs a { color: #333333; text-decoration: none; } #cs li { table-layout:fixed; width: 200px; overflow: hidden; text-overflow:ellipsis; height: 25px; line-height: 25px; } p { text-align: center; font-size: 12px; } --> </style> </head> <body> <ul id="cs"> <li>·<a href="#">这里是标题长度控制最</a> <a href="#">这里是标题长度控制最</a></li> <li>·<a href="#">这里是标题长</a> <a href="#">这里是标题长度控制最</a></li> </ul> <!-- 下面是调用代码,可根据自己需要做相应的调整 {dede:arclist row='4' titlelen='20' } [field:global name=autoindex runphp="yes"](@me % 2 == 0)?@me="":@me="<li>·";[/field:global]<a href=http://www.dede58.com/a/dedejq/"[field:arcurl/]" target='_blank'>[field:array runphp='yes'] if (@me['shorttitle']=='') @me=@me['title'];else @me=@me['shorttitle'];[/field:array] </a>[field:global name=autoindex runphp="yes"](@me % 2 == 0)?@me="</li> ":@me="";[/field:global] {/dede:arclist} --> <p>DedeCMS 调用一行2列字数智能控制方法<br /><br /> 本代码基于DedeCMS开发。<br /><br /> <font color="#FF0000">使用时请注意:</font><br /><br /> <font color="#FF0000">titlelen请大于整个li标签内的一半字符最好大于2-4个;</font><br /><br /> <font color="#FF0000">如果感觉显示效果不好或出错可以用短标题来做吃调整;</font><br /><br /> 版权归作者所有,转载请标明!<br /><br /> 网站支持<a href=http://www.dede58.com/a/dedejq/"http:/www.dede58.com">昆网</a></p> </body> </html>  

<br /><center>如不能显示效果,请按Ctrl+F5刷新本页,更多网页代码:<a href='' target='_blank'></a></center>