如何将图像置于绝对div中心

时间:2014-05-23 18:48:16

标签: html css css3

您好,当我将鼠标悬停在图像上时,如何将此放大? 这是我的jsfiddle

.portfolio-bt{
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -29px;
    margin-left: -35px;
    background: none;
    border-radius: 0px;
    border:1px solid #fff;  
}

1 个答案:

答案 0 :(得分:1)

使用:

.portfolio-bt {
    position: absolute;
    top: 0;
    left: 0;
    bottom:0;
    right:0;
    margin:auto;
    width:470px;
    height:380px;
    background: none;
    border-radius: 0px;
    border:1px solid #fff;
}

jsFiddle example

相关问题