迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發(fā)框架,基于MIT開源許可協(xié)議發(fā)布,免費且不限制商業(yè)使用,是免費開源的產(chǎn)品,以萬端互聯(lián)為設計理念,支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
聯(lián)系官方銷售客服
1835022288
028-61286886
模板標簽里面
手機端和PC端模板分開,手機端的圖片如何去掉img圖片標簽的寬高呢?
<img src="/uploads/allimg/211011/1-2110110910204R.jpg" alt="容易致病的做菜習慣" width="500" height="354" />
這是編輯器里的,只需要在手機端模板替換掉寬高的怎么寫代碼?
http://m.223987.com/wenda/43619.html
往下拉,看常見錯誤
百度搜的方法
html部分
<body onload='clearheight()'> <div id='con'> <p>這里是內(nèi)容,很多圖片內(nèi)容啊<p> </div> </body>
js部分
<script type="text/javascript"> function clearheight() { var e=document.getElementById("con"); var scon=e.innerHTML; scon = scon.replace(/[ t]*height[ t]*=[ t]*("[^"]+")|('[^']+')/ig,""); scon = scon.replace(/[ t]*height[ t]*=[ t]*[^ t]+/ig,"");e.innerHTML=str1; } </script>
替換就行了
回復@細水長流 寬高不一樣不行呢
在config/custom.php文件里面加一個自定義函數(shù)
function myClearHtml($content) { $content = preg_replace("/width=.+?['|\"]/i",'',$content);//去除樣式 $content = preg_replace("/height=.+?['|\"]/i",'',$content);//去除樣式 $content = preg_replace('/width\s*:\s*\d+\s*px\s*;*/is','',$content);//去除樣式 $content = preg_replace('/height\s*:\s*\d+\s*px\s*;*/is','',$content);//去除樣式 return $content; }
show.html 默認的是
{$content}
改成
{myClearHtml($content)}
樓主是高手,先收藏起來
這方法很硬!
.class img {
width: 100%!important;
height: auto!important;
}
都是基本操作
.class img{ width:100%!important;height:100%!important; text-align:center; }
.class table{ width:100%!important;height:100%!important;}
強制騷操作,完美解決
http://m.223987.com/wenda/43619.html
往下拉,看常見錯誤
百度搜的方法
html部分
js部分
替換就行了
回復@細水長流 寬高不一樣不行呢
在config/custom.php文件里面加一個自定義函數(shù)
show.html 默認的是
改成
樓主是高手,先收藏起來
這方法很硬!
.class img {
width: 100%!important;
height: auto!important;
}
都是基本操作
.class img{ width:100%!important;height:100%!important; text-align:center; }
.class table{ width:100%!important;height:100%!important;}
強制騷操作,完美解決