0

I do not have access to the HTML file and we use a CDN for jQuery (so assume I don't have access to that as well).

How do I go about "deleting" a rule using my own custom CSS? I am attaching a picture with the CSS rule I want deleted.

This is how it looks: with radio buttons

This is how I want it to look:

without radio buttons

ShadyBears
  • 3,955
  • 13
  • 44
  • 66
  • 1
    You can just load your own stylesheet after that of jQuery mobile's CSS, and override the background property. – Terry May 15 '16 at 20:21
  • I understand that you can override it... but I don't want a background position at all. Is that possible? – ShadyBears May 15 '16 at 20:22
  • 1
    `background-position` is used in conjunction with `background-image`, usually. You can simply set the latter to none. – Terry May 15 '16 at 20:23
  • 1
    As a side-note, all styles have a "default" value. When you say "delete", you really just want to set it to the "default". So, for example (per @Terry comment) - you can reset the background image (which is *really* what you want to remove) to "none": `background-image: none;` – random_user_name May 15 '16 at 20:27
  • Thank you guys! That makes sense. – ShadyBears May 15 '16 at 20:37

2 Answers2

0

If you just want the background-position to have no effect on the position of the image, use this:

.ui-icon-radio-off {
    background-position: 0 0;
}

But if you want to reset it to what it was supposed to be set to if that default jquery css wasn't there, then you can unset it like this:

.ui-icon-radio-off {
    background-position: initial;
}

N.B. You mgiht have to add an !important tag to the above properties if jquery renders the css property below the above property.

AndrewL64
  • 15,794
  • 8
  • 47
  • 79
  • Given that you have no idea what the "initial" value was, it seems safer to use "none" instead. – random_user_name May 15 '16 at 20:35
  • @cale_b `background-position` doesn't accept a `none` value though. And do edit my answer with the correct definition of what inital does and I'll approve it if it's correct. Cheers – AndrewL64 May 15 '16 at 20:38
  • True enough. I misread your answer - what the OP (I believe) is really after is background-image none.... – random_user_name May 15 '16 at 20:39
0

Some browsers accept the all CSS definition. What it does it resets or reverts all the CSS definition for all elements matching the CSS selector.

.my-class {
    all: none;
}

Here is an good example from https://stackoverflow.com/a/31317986/3856582

#someselector {
    all: initial;
    * {
        all: unset;
    }
}

Or use the CSS initial keyword on any CSS definition.

Community
  • 1
  • 1
aifrim
  • 555
  • 9
  • 20