【发布时间】:2017-09-13 00:10:07
【问题描述】:
我有显示图像的模式。我将模态图像的高度设置为 90%,宽度会自动缩放,因此图像不会被拉伸。但在手机上,我希望不定义height,我只想将宽度定义为 100%。如何使小屏幕上的图像高度未定义?到目前为止,我有这个代码:
.image {
height: 80%;
}
@media only screen and (max-width: 700px){
.image {
width: 100%;
/* make height not defined?!
}
}
【问题讨论】: