Created
September 16, 2013 05:40
-
-
Save ch-gilbert/6577034 to your computer and use it in GitHub Desktop.
纯CSS控制不固定宽高图片div内水平垂直均居中
(http://sandbox.runjs.cn/show/c9zvoil2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
.img-outSide{ | |
width: 500px; | |
height: 750px; | |
border: 1px solid #CDCDCD; | |
text-align: center; | |
} | |
.img-inSide,.img-con{ | |
display: inline-block; | |
vertical-align: middle; | |
} | |
.img-inSide{ | |
height: 100%; | |
} | |
</style> | |
<div class="img-outSide"> | |
<a href="#" class="img-con"> | |
<img style="float: left;" src="http://sandbox.runjs.cn/uploads/rs/234/k0xxr73w/1.jpg" /> | |
</a> | |
<b class="img-inSide"></b> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment