I am having trouble applying a style that is !important
. I’ve tried:
$(\"#elem\").css(\"width\", \"100px
I would assume you tried it without adding !important
?
Inline CSS (which is how JavaScript adds styling) overrides the stylesheet CSS. I'm pretty sure that's the case even when the stylesheet CSS rule has !important
.
Another question (maybe a stupid question but must be asked.): Is the element you are trying to work on display:block;
or display:inline-block;
?
Not knowing your expertise in CSS... inline elements don't always behave as you would expect.