css - 是否可以在屏幕边框下方修复高度未知的元素?

标签 css

我正在构建一个将从屏幕底部滑出的东西。我不知道它的高度。

如果我知道我能做到的高度

position: fixed;
bottom: -200px //height of object

我使用 css-animations 将它滑出,它会滑到 bottom: 0 因此我也不能使用 top: 100%; 来隐藏对象.还有其他选择吗?

最佳答案

这是我提出的解决方案。使用 translateY 移动它。

CSS

.slidingthing {
    position: fixed;
    top: 100%;

    /* or margin-top in your case?
    margin-top: 100% */

    height: 100px; // or whatever
    width: 100px; // or whatever
    transform: translateY(-100%); // add other browser vendor prefixes
}

fiddle : http://jsfiddle.net/vKW65/4/

关于css - 是否可以在屏幕边框下方修复高度未知的元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23510907/

相关文章:

javascript - 关于html中的 "paragraph sliding"

css - 绝对定位元素,但位于另一个元素的右侧

CSS 文本选择颜色溢出到框外

jquery - 在导航栏上的事件链接后面放置背景图像

html - Div定位和 float 选项

css - Stylus 中用于框阴影的多线属性

javascript - 从左到右连续呈现 div 列表,然后从下到上呈现行(通过 CSS/jQuery)

javascript - 通过javascript创建一个无序列表

javascript - 用一些东西代替 <span> 以有效的方式包裹 <ul>

javascript - 如何制作自己的自定义小部件,如 facebook 社交插件?