<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

织梦DedeCMS手机端文章内容图片设置自适应屏幕的方法

时间:2020-12-15

织梦dedecms默认的文章内容里面的图片是固定大小的,这样在手机端里面就可能会导致图片不能完整显示,甚至把屏幕撑开,这样非常不友好,所以这里就给大家分享一个方法,让手机端的文章内容里面的图片能够自适应图片大小。

 

方法如下:

 

找到并打开手机端的文章内容页模板,将里面的{dede:field.body/}标签修改一下,改为如下的标签:

 

01 {dede:field.body runphp=yes}
02 global $cfg_basehost;
03 $str = @me;
04 $search '/(<img.*?)width=(["\'])?.*?(?(2)\2|\s)([^>]+>)/is';
05 $search1 '/(<img.*?)height=(["\'])?.*?(?(2)\2|\s)([^>]+>)/is';
06 $search2 '#(<img.*?style=".*?)width:\d+px;([^"]*?.*?>)#i';
07 $search3 '#(<img.*?style=".*?)height:\d+px;([^"]*?.*?>)#i';
08 $content = preg_replace($search,'$1$3',$str);
09 $content = preg_replace($search1,'$1$3',$content);
10 $content = preg_replace($search2,
0