[英]!important javascript css where would it go
I have a javascript file containing css : 我有一个包含css的javascript文件:
a(this).css({
position:"fixed",
top: "210px",
left: "1450px" ,
width: "30px",
height: "30px",
margin: "0",
padding: "0",
minWidth: "65px",
listStyleType: "none",
zIndex: 1e7
});
The top and left seems to get changed somewhere else when I resize the screen. 调整屏幕大小时,顶部和左侧似乎在其他地方发生了变化。 Where to I add
!important
to them to see if that works? 我在哪里添加
!important
对他们来说是否有效?
a(this).css({
"position": "fixed",
"top": "210px !important",
"left": "1450px !important",
"width": "30px",
"height": "30px",
"margin": "0",
"padding": "0",
"minWidth": "65px",
"listStyleType": "none",
"zIndex": 1e7
});
But if you are changing so many values, I advise you to use a class instead. 但是,如果要更改许多值,我建议您改用一个类。 If the above doesn't work:
如果上述方法不起作用:
a(this)
refers to the right element? a(this)
指向正确的元素吗? !important
there !important
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.