Jump to content

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


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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...