pstein Posted March 7, 2021 Share Posted March 7, 2021 (edited) 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 March 7, 2021 by pstein Link to comment Share on other sites More sharing options...
niche Posted March 7, 2021 Share Posted March 7, 2021 https://css-tricks.com/snippets/css/comments-in-css/ 1 Link to comment Share on other sites More sharing options...
dsonesuk Posted March 8, 2021 Share Posted March 8, 2021 Its padding-bottom: 10px !important; NOT! padding:bottom: You have to clear it manually or with javascript. Link to comment Share on other sites More sharing options...
pstein Posted March 8, 2021 Author Share Posted March 8, 2021 (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 March 8, 2021 by pstein Link to comment Share on other sites More sharing options...
dsonesuk Posted March 8, 2021 Share Posted March 8, 2021 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now