html - 从下往上堆叠元素

标签 html css

我正在开发一个通知系统,我希望我的通知从右下角开始,然后堆叠到右上角。我怎么做?比如我如何强制它从屏幕底部开始?

代码:http://jsfiddle.net/2TdCx/

当前的 CSS:

#notifications {
width: 280px;
right: 0;
bottom: 0;
float: right;
position: fixed;
z-index: 9999;
height: 100%;
top: 40px;
margin-right: 3.5px;
}

.notification {
font-size: 12px;
width: 270px;
min-height: 20px;
background: #000;
color: #FFF;
border-radius: 6px;
padding-left: 10px;
padding-top: 2.5px;
padding-bottom: 2.5px;
margin-top: 10px;
opacity: 0.8;
}

最佳答案

我能想到的唯一方法是使用 CSS3 rotate transform 垂直翻转容器和元素本身。

jsFiddle Demo

#notifications, .notification {
    -webkit-transform: rotate(180deg);
       -moz-transform: rotate(180deg);
         -o-transform: rotate(180deg);
        -ms-transform: rotate(180deg);
            transform: rotate(180deg);
}

关于html - 从下往上堆叠元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18966226/

相关文章:

javascript - 浏览器中 100% 宽度的视频的不同高度

css - 背景图像在 IE8 及以下版本中居中/固定的问题

html - 如何将 ul 中的内容移动到中心 HTML + CSS

html - Safari 扩展中的 iFrame "Popover"

html - 删除表格之间的间距

javascript - 通过循环构建 JSON 数组

html - 需要在主页上识别元素 - Wordpress

CSS 布局 - 不使用任何填充时的空白

javascript - 单击其元素时,我的汉堡菜单消失了

javascript - 如果存在值(value),就这样做。未定义与空?