如何覆盖left:0使用CSS或Jquery? [英] how to override left:0 using CSS or Jquery?

查看:99
本文介绍了如何覆盖left:0使用CSS或Jquery?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个元素,它有以下CSS:

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.

这很容易,如果我刚刚删除 left:0 ,但我不能篡改上述CSS,所以我需要一些CSS或Jquery覆写,停用或移除 left:0 CSS。

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.

感谢您的协助!

推荐答案

left 的默认值为

The default value for left is auto, so just set it to that and you will "reset" it.

.elem {
  left: auto;
}

确保上述文件位于原始CSS文件之后。

Make sure that the above comes after the original CSS file.

这篇关于如何覆盖left:0使用CSS或Jquery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆