Search code examples
cssadblock

Fixing the width of a div via CSS override in uBlock Origin


I'm trying to make the comments wider on Slashdot, especially on mobile (Firefox). There is a big gap on the left.

Example: https://tech.slashdot.org/story/21/08/12/2034218/google-launches-interactive-3d-periodic-table-to-teach-chemistry

(any Slashdot story will work)

The selector is div#comments.a2commentwrap. Examining it you can see that it has the property margin-right: 320px; and if you reduce it to 20px the big gap goes away. I can't get the rule to work though. I have

slashdot.org##div#comments.a2commentwrap:style(margin-right: 20px; !important;)

but it has no effect. I tested background-color: #333!important; and that worked.

What am I doing wrong?


Solution

  • It's because you terminated your style with ; before !important flag

    slashdot.org##div#comments.a2commentwrap:style(margin-right: 20px !important;)