我正在开发一个通知系统,我希望我的通知从右下角开始,然后堆叠到右上角。我怎么做?比如我如何强制它从屏幕底部开始?
当前的 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
垂直翻转容器和元素本身。
#notifications, .notification {
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-o-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg);
}
- P.S - 注意这个 CSS 属性有一些 browser support issues .
关于html - 从下往上堆叠元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18966226/