CSS(webkit):在绝对定位的元素上覆盖顶部和底部 [英] CSS (webkit): overriding top with bottom on absolute-positioned element

查看:373
本文介绍了CSS(webkit):在绝对定位的元素上覆盖顶部和底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在覆盖一些插件CSS时遇到问题.直接编辑CSS并不是真正的选择,因为这样做会使更新插件的风险更大.

I'm having a problem with overriding some plugin CSS. Editing that CSS directly is not really an option, as it would make updating the plugin more risky.

问题:元素具有绝对定位,并且在原始元素中具有top:0px.我想用bottom:0px覆盖它.

The problem: an element has absolute positioning, and has top:0px in the original. I want to override it by bottom:0px.

为了示例

    .element {position:absolute; top:0;}

    /* in another file */
    .my .element {bottom:0;}

在Firefox上可以正常使用(底部为0:应用的样式),但Safari/chrome似乎并没有超越顶部:0.

On firefox this works ok (bottom:0 is the applied style), but safari/chrome don't seem to be get over the top:0.

我可以解决此问题,但是想出一个干净的解决方案会很好.

I can work around this problem, but it would be nice to come up with a clean solution.

推荐答案

使用top: autotop重置为 bottomtop的完全独立属性(元素可以同时具有top ),所以也许您将不再需要bottom.

bottom is a totally separate property to top (an element can have both a top and bottom), so perhaps you won't need bottom anymore.

还要确保您的替代选择器足够具体,但是听起来不是这种情况下的问题.

Also, make sure your override selector is specific enough, but it doesn't sound like that's the problem in this case.

这篇关于CSS(webkit):在绝对定位的元素上覆盖顶部和底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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