什么我遇到的是,图像会被坐在虽然CSS是说应该坐在股利的方式过分max-height的700。
任何帮助表示赞赏
#largephotohold {
border: 0px black solid;
position: fixed;
bottom: 0px;
width: 90%;
margin-left: 5%;
background-color: white;
text-align: center;
border: 3px solid red;
max-height: 700px;
}
#largephotohold IMG {
max-height: 100%;
max-width: 100%;
}Run Code Online (Sandbox Code Playgroud)
<DIV id="largephotohold">
<img src="http://i.imgur.com/AUn1uj6.jpg">
</DIV>Run Code Online (Sandbox Code Playgroud)
在元素上应用百分比高度时,需要在 parent 上设置 aheight。设置 amax-height或min-height不起作用(如您所见)。必须是height财产。
对于插图,将 切换max-height: 700px到height: 700px。现在您的图像高度有效。
替代解决方案:既然你告诉你的图像是max-height: 100%,一个容器的max-height: 700px,为什么不也告诉图像是max-height: 700px?这将带您解决百分比高度问题。
更多信息:
| 归档时间: |
|
| 查看次数: |
3867 次 |
| 最近记录: |