2

I have an elements with

<div class="item" style="transform: translate3d(0px, -215px, 0px);">
 <a href="img.jpg" data-lightbox="one"><img src="img.jpg"></a></div>

styling.

What I need to do is to get rid of inline style of element and overwrite it with media queries css. Is something like that possible or do I need to do it with javascript?

Atula
  • 2,177
  • 2
  • 12
  • 28
Darlyn
  • 4,715
  • 12
  • 40
  • 90
  • 1
    use `!important` in your css. – murli2308 Apr 26 '16 at 13:24
  • 3
    Do you mean you want to remove the `style` attribute from that tag completely and move the styles it contains to a stylesheet? Or do you mean you want/have to keep the `style` attribute but want to override it from your stylesheet? – Shaggy Apr 26 '16 at 13:24

2 Answers2

3

You could use !important here

div.item {
  transform: none !important;
}
<div class="item" style="transform: translate3d(0px, -215px, 0px);"> <a href="img.jpg" data-lightbox="one"><img src="img.jpg">lorem</a></div>
Nenad Vracar
  • 118,580
  • 15
  • 151
  • 176
1

You can use !important in your rules, and then then will override inline styles. See W3 docs

Mike Jerred
  • 9,551
  • 5
  • 22
  • 42