0
我正在制作一个侧边栏实时聊天按钮,但是我无法制作垂直图像:“实时聊天”位于容器的中心。在动画div中定位图像 - 粘贴到屏幕左侧
尽管做了一些努力,但我无法将图像显示在正确的位置。
HTML
<a id="xfmd" href="#">
<span class="image"></span>
</a>
CSS
#xfmd
{
position:fixed;
display:block;
top:40%;
width:35px;
height:95px;
padding:5px;
left:-10px;
z-index:10;
cursor:pointer;
background-color:#0094e8;
-webkit-border-top-right-radius:5px;
-webki-border-bottom-right-radius:5px;
-moz-border-radius-topright:5px;
-moz-border-radius-bottomleft:5px;
border-top-right-radius:5px;
border-bottom-right-radius:5px
}
#xfmd .image
{
display:block;
width:17px;
height:83px;
margin:1px 6px 6px 8px;
background:url(http://daemex.com/assets/img/ui.png) no-repeat 0
}
#xfmd:hover
{
left:0;
transition:.3s;
-webkit-transition:.3s,
}
@media (max-width:992px) {
#xfmd
{
top:35%
}
}
@media (max-width:768px) {
#xfmd
{
width:25px;
background-position:10px 50%;
top:30%
}
}
@media (max-height:420px) {
#xfmd
{
top:20%
}
}
垂直居中?还是水平居中? – Brian 2015-03-31 13:50:09
你可以创建一个小提琴/笨蛋显示这个问题? – 2015-03-31 14:16:38
检查您的媒体质量css其影响最高的图像百分比。在这个链接http://jsfiddle.net/TMDineshUID/sqaspy79/1/我写出了媒体问答。 – 2015-03-31 14:34:53