Home:ALL Converter>how to override left:0 using CSS or Jquery?

how to override left:0 using CSS or Jquery?

Ask Time:2012-04-11T17:04:20         Author:frequent

Json Formatter

I have an element, which has the following CSS:

.elem {
  left: 0;
  position: fixed;
  right: 0;
  width: 60%;
  z-index: 1000;
  }

The element does not span the whole screen. I would like it to "align" to the right hand side of the screen.

This would be easy, if I just removed left: 0, but I cannot tamper with the above CSS, so I need some CSS or Jquery to override, disable or remove the left:0 CSS.

Thanks for help!

Author:frequent,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/10102915/how-to-override-left0-using-css-or-jquery
Jan Hančič :

The default value for left is auto, so just set it to that and you will \"reset\" it.\n\n.elem {\n left: auto;\n}\n\n\nMake sure that the above comes after the original CSS file.",
2012-04-11T09:06:51
Mohammad Anini :

Using CSS:\n\n.elem {\n left: auto;\n}\n\n\nUsing JQuery:\n\n$(\".elem\").css(\"left\", \"auto\");\n",
2013-04-22T13:43:42
Dion :

Try auto property in CSS, which is equal to the default value.",
2012-04-11T09:08:45
Antonio Beamud :

With jquery:\n\n$(\".elem\").css(\"left\", \"\");\n",
2012-04-11T09:09:53
yy