[英]css max-height or max-width to restrict image size
max-height
to restrict the size of an image?max-height
来限制图像的大小? Both max-width
and max-height
can be used to restrict the size of en element. max-width
和max-height
都可以用来限制元素的大小。
This WC article suggests using max-width
to fit the image in its container.这篇 WC 文章建议使用
max-width
使图像适合其容器。 https://www.w3.org/WAI/WCAG21/Techniques/css/C37 https://www.w3.org/WAI/WCAG21/Techniques/css/C37
Is there any reason not to use max-height
to restrict size of an image should you have a web applicatin with vertical content flow ?如果您有一个具有垂直内容流的 web 应用程序,是否有任何理由不使用
max-height
来限制图像的大小?
https://developer.mozilla.org/en-US/docs/Web/CSS/max-height https://developer.mozilla.org/en-US/docs/Web/CSS/max-height
https://developer.mozilla.org/en-US/docs/Web/CSS/max-width https://developer.mozilla.org/en-US/docs/Web/CSS/max-width
max-height vs. max-width: the case for setting max-width最大高度与最大宽度:设置最大宽度的情况
With that being said, it is up to you to determine which to use based on your requirements话虽如此,您可以根据自己的要求决定使用哪个
Yes.是的。 Some pages have content placed horizontally:)
有些页面的内容是水平放置的:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.