以下是我的 fiddle ,我试图在右侧制作粘性按钮。我面临的问题是它没有垂直居中对齐,并且在 IE 9 上不起作用。请让我知道如何解决这个问题。
fiddle : http://jsfiddle.net/Zw8Sb/
#feedback {
height: 0px;
width: 65px;
position: fixed;
right: 0;
top: 55%;
z-index: 1000;
transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
#feedback a {
display: block;
background: #06c;
height: 15px;
width: 165px;
padding: 8px 16px;
color: #fff;
font-family: Arial, sans-serif;
font-size: 17px;
font-weight: bold;
text-decoration: none;
border-bottom: solid 1px #333; border-left: solid 1px #333; border-right: solid 1px #fff;
}
#feedback a:hover {
background: #CCC;
}
最佳答案
怎么样this fiddle?
CSS:
.center{
position: fixed;
top: 50%;
right: 0px;
width: 115px;
height: 0px;
text-align:right;
z-index:9999;
margin-top:-15px;
}
.center a{
transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
display: block;
background: #06c;
text-align:center;
height: 15px;
width: 165px;
padding: 8px 16px;
color: #fff;
font-family: Arial, sans-serif;
font-size: 17px;
font-weight: bold;
text-decoration: none;
border-bottom: solid 1px #333; border-left: solid 1px #333; border-right: solid 1px #fff;
}
.center a:hover {
background: #CCC;
}
关于html - 粘性固定右侧按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19974003/