html - 粘性固定右侧按钮

标签 html css

以下是我的 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/

相关文章:

javascript - 移动跨度标签动画

css - 应用 CSS 时,Flex 按钮组件的边框模糊并改变宽度

html - html中背景图像和图像之间的差距

javascript - 有没有办法纯粹通过 CSS 来做到这一点?

jquery - 如何使 Bootstrap 轮播 slider 使用移动左/右滑动

java - 如果不使用 <form> 声明,则使用 jquery 获取 Radio 值不起作用

jquery - 使用 CSS3 的可扩展菜单项

jquery - CSS 菜单下拉定位

java - 如何从客户端访问服务器C盘下的文件?

javascript - 如何使用预选值初始化下拉列表(<select/>)然后更改它?