Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基本上我想要的只是一大堆图像,它们只是一个在彼此之下。所有这些图像的大小和纵横比都非常不同。我希望所有图像都是最大宽度和最大高度,而不改变每个图像的纵横比。我将如何使用 html 5 和 css3 做到这一点?
取一个父块,例如一个div带有类名的块,main_div然后添加这个 CSS
div
main_div
.main_div img { width:100%; height: auto; }