Jump to content

remove inner style: <div class="foobar" style="/*! padding-bottom:......% */">?


pstein
 Share

Recommended Posts

Assume I have loaded a webpage which contains multiple <div> elements which contain inner style definitions like

<div class="foobar" style="/*! padding-bottom:22% */">?

1.) Why is the inner style definition enclosed in /*!........*/  

Never seen that before.

2.) How can I set the "padding-bottom" value to 10px for all <div> elements which contain a padding-bottom definition inside the tag itself (=NOT in separate CSS stylesheet)?

3.) How can I set the "padding-bottom" value to 10px for all <div> elements which have a class="foobar")?

div.foobar { padding:bottom: 10px !important"; }

seems not to help since the inner style="......" definition has always a higher priority than the outside CSS stylesheet definition even when it has an !important attribute.

4.) Alternatively: How can I remove the whole atyle="......" definition"?

 

 

 

Edited by pstein
Link to comment
Share on other sites

Posted (edited)

Sorry, it was a typo from me. I originally meant

padding-bottom: 10px !important;

 

...but this does not help either.

How can I remove all style="......" definitions for all div.foobar elements?

Edited by pstein
Link to comment
Share on other sites

IF you can loop through the div elements, with class 'foobar', then you can remove the style attribute with .removeAttribute('style') IN javascript OR possibly php curl or similar to retrieve content, filter the content of inline styling and use that filtered content instead. If you can't do this! Then you can't do anything to change the inline styling using '!important'.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...