<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 5 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 5 年前。
我的网站是在 Wordpress 上构建的,使用主题“BeTheme”,它会创建类似空内联样式 (style="") 的 html 垃圾。
我怎样才能删除它?
我想到了两种方法:如果我知道样式属性附加在哪个 php-File 中,我可以做类似的事情
if (style is empty)
{
don't attach style attribute
}
如果我不能到达那里,我可以在之后用类似的东西清理页面
replace(style="", '')
我怎样才能以一种优雅的方式实现这一点,而不减慢我的页面速度?
最佳答案
if ($("div").attr("style").length<=0)
{
$("div").removeAttr("style");
}
关于css - 删除类似样式 =""的 html 垃圾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46104922/