我需要修改我的Css。这是我的CSS
.msg {
background-color: #fff;
border: 3px solid #fff;
display: inline-block;
left: 50%;
color:#123456;
opacity: 0;
padding: 35px;
position: fixed;
text-align: justify;
top: 40%;
visibility: hidden;
z-index: 10;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}如何删除下面的部分,并取得相同的结果?
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);发布于 2014-03-04 20:46:10
如果您可以为.msg定义一个特定的高度,这可能是可行的。
.msg {
background-color: #fff;
border: 3px solid #fff;
display: inline-block;
height:200px; /*If you can define this*/
width:200px; /*and this*/
top:calc(40% - 100px); /*then use calc() to subtract half of .msg from top*/
left:calc(50% - 100px); /*then use calc() to subtract half of .msg from top*/
color:#123456;
opacity: 0;
padding: 35px;
position: fixed;
text-align: justify;
visibility: hidden;
z-index: 10;
}https://stackoverflow.com/questions/22182448
复制相似问题