Last active
December 14, 2015 18:59
-
-
Save safaring/5132798 to your computer and use it in GitHub Desktop.
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
| h3 {text-align: center; font-family: Microsoft Yahei;} | |
| .box {width: 500px; height: 300px; background-color: #eee;margin: 0 auto; text-align:center; border: 1px solid #ddd;margin-bottom: 10px;font-size:0; *font-size:200px;-webkit-text-size-adjust:none;} | |
| .box img {vertical-align: middle;} | |
| .box:after {display:inline-block; width:0; height:100%; content:"center"; vertical-align:middle; overflow:hidden;} |
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
| <h3>未知尺寸的图片的水平垂直居中</h3> | |
| <div class="box"> | |
| <img src="http://img.xiami.com/images/collect/148/48/16773148_1362894437_4.jpg" /> | |
| </div> | |
| <div class="box"> | |
| <img src="http://img.xiami.com/images/album/img78/1578/168564_2.jpg" /> | |
| </div> |
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
| {"view":"split","fontsize":"120","seethrough":"","prefixfree":"1","page":"javascript"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment