How to delete a CSS statement from GM? Or delete at least a "width" attribute within a CSS statement?

20 views
Skip to first unread message

Ben Stover

unread,
Jun 17, 2016, 1:49:56 AM6/17/16
to Greasemonkey Users
Assuem I have a CSS for a web page like

.content > img { width: 100% !important; }

Now I want to delete this statement from a Greasemonkey script.

How do I do this?

The following commands do NOT work:

GM_addStyle(".content > img { !important; }");

or

GM_addStyle(".content > img { width !important; }");

Related question: Assume the original CSS statement at the top contains further attributes like "height: 90px;"
But I only want to delete the "width" attribute (=not the whole CSS statement).

How else can I achieve this?

Ben





Klaus Johannes Rusch

unread,
Jun 17, 2016, 3:26:13 AM6/17/16
to greasemon...@googlegroups.com
On 2016-06-17 07:49, 'Ben Stover' via greasemonkey-users wrote:
> Assuem I have a CSS for a web page like
>
> .content > img { width: 100% !important; }
>
> Now I want to delete this statement from a Greasemonkey script.
>
> How do I do this?
Not really a Greasemonkey question. You simply need to change the CSS
width property to the default value:
http://www.w3schools.com/cssref/pr_dim_width.asp

--

Klaus Johannes Rusch
klaus...@atmedia.net
http://klausrusch.atmedia.net/

Reply all
Reply to author
Forward
0 new messages