HTML代码如下:

<!DOCTYPE html>
<html>
<head>
    <style>
        .image-container {
            display: flex;
        }

        .image-container img {
            margin-right: 5px;
        }
    </style>
</head>
<body>
    <div class="image-container">
        <img src="image1.jpg" alt="Image 1" width="200" height="200">
        <img src="image2.jpg" alt="Image 2" width="200" height="200">
        <img src="image3.jpg" alt="Image 3" width="200" height="200">
        <img src="image4.jpg" alt="Image 4" width="200" height="200">
    </div>
</body>
</html>

其中,.image-container 类设置了 display: flex; 属性,使图片可以水平排列。.image-container img 类设置了 margin-right: 5px; 属性,为每个图片添加右侧间距。你可以根据需要修改图片的宽度、高度、路径和间距大小

html写一个间距很小四个图片并排的页面

原文地址: https://www.cveoy.top/t/topic/iUrc 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录