テキスト要素の特徴は、テキスト区切り文字、キャリッジリターン、またはスペースで区切ることができることです。たとえば
、imgは行レベルのブロック要素であり、inline-blockはインライン属性の特性を持っています。
次の例では、imgタグの間にキャリッジリターンがあり、画像が区切られています。出品済み
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<img src="./d043ad4bd11373f02efb63adad0f4bfbfbed043f.png" alt="">
<img src="./d043ad4bd11373f02efb63adad0f4bfbfbed043f.png" alt="">
<img src="./d043ad4bd11373f02efb63adad0f4bfbfbed043f.png" alt="">
<img src="./d043ad4bd11373f02efb63adad0f4bfbfbed043f.png" alt="">
</body>
<style>
* {
margin: 0;
padding: 0;
}
img{
width:300px
}
</style>
</html>
これで、img間にキャリッジリターンが設定されなくなりました
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<img src="./d043ad4bd11373f02efb63adad0f4bfbfbed043f.png" alt=""><img src="./d043ad4bd11373f02efb63adad0f4bfbfbed043f.png" alt=""><img src="./d043ad4bd11373f02efb63adad0f4bfbfbed043f.png" alt=""><img src="./d043ad4bd11373f02efb63adad0f4bfbfbed043f.png" alt="">
</body>
<style>
* {
margin: 0;
padding: 0;
}
img{
width:300px
}
</style>
</html>