迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發框架,基于MIT開源許可協議發布,免費且不限制商業使用,是免費開源的產品,以萬端互聯為設計理念,支持的微信公眾號、小程序、APP客戶端、移動端網站、PC網站等多終端式管理系統。
聯系官方銷售客服
1835022288
028-61286886
模板標簽里面
手機端和PC端模板分開,手機端的圖片如何去掉img圖片標簽的寬高呢?
<img src="/uploads/allimg/211011/1-2110110910204R.jpg" alt="容易致病的做菜習慣" width="500" height="354" />
這是編輯器里的,只需要在手機端模板替換掉寬高的怎么寫代碼?
http://www.zbshanke.com/wenda/43619.html
往下拉,看常見錯誤
百度搜的方法
html部分
<body onload='clearheight()'> <div id='con'> <p>這里是內容,很多圖片內容啊<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文件里面加一個自定義函數
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://www.zbshanke.com/wenda/43619.html
往下拉,看常見錯誤
百度搜的方法
html部分
js部分
替換就行了
回復@細水長流 寬高不一樣不行呢
在config/custom.php文件里面加一個自定義函數
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;}
強制騷操作,完美解決