您当前的位置:首页 > 编程技术

帝国cms电脑端和手机版新闻内容如何自适应?修改模板处css

时间:2021-07-27 10:00:33  来源:网络    编辑:本站  点击:

在电脑端和手机端新闻内容模板里面[!--newstext--]处修改

 

源文件为:

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="text">
[!--newstext--] 
<p align="center" class="pageLink">[!--page.url--]</p></td>
</tr>
</table>

修改为:

 

<table style="table-layout:fixed;word-break:break-all;" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="text" class="text2">
<style>
.text2{overflow:hidden;} 
.text2 img{ max-width: 100%; border: 1px dashed #ccc;display: table-cell; vertical-align: middle; text-align: center;margin: 0 auto;}
.text2 p {line-height: 38px; border-top: 1px solid rgb(192, 220, 192); padding-top: 10px; text-indent: 
2em; font-size: 19px; letter-spacing: 1px; font-family:  'Microsoft YaHei';  white-space: 
normal;text-align:justify;}
.text2 a{word-wrap:break-word;word-break:break-all;}
.text2 h1{text-indent: 2em;}
.text2 h2{text-indent: 2em;}
.text2 h3{text-indent: 2em;}
</style>
[!--newstext--] 
<p align="center" class="pageLink">[!--page.url--]</p></td>
</tr>
</table>
 

 

覆盖,重新刷新即可。

 

宽度最大不超过max-width: 100%

 a{word-wrap:break-word;word-break:break-all;}目的是设置的超链接不要撑开手机页面

 

 

点赞
返回首页
返回
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
栏目导航

| 传统文化 | 武术天地 | 编程技术 | 好听音乐 | 养生中医 | 智慧人生 | 常用工具 | 写作园地 | 影视娱乐 | php专栏 | 道德经专栏 |
最新推荐
python内建函数大全(built-in functions)
python内建函数大…
点击按钮(button)打开新窗口(window)
点击按钮(button)…
帝国cms网络视频引用代码--具体操作教程
帝国cms网络视频引…
相关文章
栏目更新
栏目热门