除了h1之外,我如何垂直居中图像,即使h1使用css在页面调整大小时换行?在此处查看 jsfiddle -> http://jsfiddle.net/JJvG6/
HTML:
<div>
<div id="img"><img></img></div>
<div id="h1"><h1>This Div and the div with the picture should always be vertically centered, when page resizes and h1 wraps.</h1></div>
</div>
CSS:
div {
margin: 5px;
border: 1px solid black;
}
div #img {
float: left
}
谢谢