如何删除包含body class下面文本的'div style'?
我尝试过css,但我可能做错了
<body class="home page page-id-14 page-template page-template-100-width page-template-100-width-php logged-in admin-bar no-customize-support fusion-body no-tablet-sticky-header no-mobile-sticky-header no-mobile-slidingbar no-mobile-totop layout-wide-mode mobile-menu-design-classic" data-spy="scroll">
<div style="position: absolute; top: 0px; left: -3434px;">
Find the latest ***** available across a*******sites
<a target="_blank"href="http://www.website.zone/">
Site.Zone
</a>
Use our complete list ......................... available online.
</div>
答案 0 :(得分:1)
试试这个,
HTML代码
<div style="position: absolute; top: 0px; background-color:green; ">Find the latest ***** available across a*******sites <a target="_blank"href="http://www.website.zone/">Site.Zone</a> Use our complete list ......................... available online.</div>
Javascript代码
document.body.children[0].removeAttribute("style");
它删除了我在jsfiddle中试过的第一个divison的样式属性。