在网页设计中,经常会需要将两张或多张图片并排放置。在CSS中,有几种方法可以实现这样的效果。首先,我们可以使用float属性。我们可以将两张图片都设置为float:left,然后再在它们共同的父元素中
p { overflow: auto; } img { float: left; } .clear { clear: both; }
p { display: flex; flex-wrap: wrap; } img { margin-right: 10px; width: 50%; }
p { display: grid; grid-template-columns: repeat(2, 1fr); } img { width: 100%; }
粉丝
0
关注
0
收藏
0