2015-11-04 26 views
0

如何刪除包含正文類下方文本的'div樣式'?從正文中刪除div樣式文本

我已經嘗試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> 

Screen Shot

+0

請提供的jsfiddle – Alex

+0

一個div必須在body元素中,而不是之前或之後。你的代碼是非常錯誤的。這可能是問題所在。 – KittMedia

+2

您可以使用CSS,只要確保在每個值後面加上'!important'就可以覆蓋'style'屬性中定義的屬性。 – Quantastical

回答

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的style屬性。

example