如何在其他图像旁边添加图像



所以我在HTML中添加了一个图像,我想在它旁边添加更多的图像。但每次尝试时,它总是放在web的下一行。我应该使用CSS吗?我需要使用什么标签或元素?

<!DOCTYPE>
<html> 
<img src="imageone"/>
<img src="imagetwo"/>
<!-- i want "imageone" to be placed next to "imagetwo"-->
</html>

将图像嵌套在父div中并给它一个类。然后使用flex

.wrapper {
display: flex;
justify-content: space-evenly;
margin: auto;
}
.wrapper img {
max-width: 100%;
}
<!DOCTYPE>
<html>
<div class="wrapper">
<img src="https://dummyimage.com/300/000/fff" />
<img src="https://dummyimage.com/300/000/fff" />
</div>
</html>

最新更新