css 智能手机景观异常的动态图像缩放

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css 智能手机景观异常的动态图像缩放相关的知识,希望对你有一定的参考价值。

/*
* Dynamic Image Scaling with Smartphone Landscape Exception
* ----------------------------------------------------------
* Pic fits screen.
* Except on smartphone landscape,
* where it fills the width, and
* overflows the height.
*/

img.dynamic-size {
	height: auto;
	width: auto;
	max-width: 100%;
}

img.dynamic-size.centered-image {
	display: block;
	margin: 0 auto;
}

	/*
	*  The max-height is the full height of the page
	*  Minus the combined height of page elements
	*  that take up vertical space,
	*  including any "padding" you'd like to add
	*/
	
@media (min-height: 480px) {
	img.dynamic-size {
		max-height: calc(100vh - 128px);
	}
}

以上是关于css 智能手机景观异常的动态图像缩放的主要内容,如果未能解决你的问题,请参考以下文章