gpt4 book ai didi

html - 图片表现异常

转载 作者:太空宇宙 更新时间:2023-11-04 09:21:03 25 4
gpt4 key购买 nike

我的 friend 在学校元素的网站上遇到了问题。他想做一个小画廊。

前 5 张图片是故意的: Image但后来他们出现了: Image我们测试了一个小时的各种东西。我们尝试将底部的 3 个放在另一个带有 class="bilder"div block 中,但结果是一样的。我们也试过把图片按不同的顺序排列,看看是否与图片本身有关,但结果也是一样的。

div.wrapper {
font-family: Calibri;
width: 100%;
float: left;
color: white;
}

h1 {
color: #F99F00;
text-align: center;
}

body {
background-color: black;
margin: 0;
padding: 0;
}

ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: black;
}

li {
float: left;
font-family: fantasy;
font-size: 120%
}

li a {
color: white;
display: block;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}

li a:hover:not(.active) {
background-color: green;
}

.active {
backround-color: green;
}

li.selected a {
color: green;
display: block;
}


#tct {

top: 15%;
left: 5%;
padding: 1%;
color: #F99F00;
font-size: 200%;
}



div.bilder img {
padding: 1%;
width: 18%;
float: left;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Counter-Strike: Global Offensive</title>
<link href="../css/waffenliste.css" rel="stylesheet" type="text/css">
<link href="pictures/csgotab.png" rel="shortcut icon" type="image/x-icon">
</head>
<body>
<div class="wrapper">
<div>
<h1>Counter-Strike: Global Offensive<h1>
</div>
<div>
<ul>
<li><a href="../index.html">Home</a></li>
<li class="selected"><a href="waffenliste.html">Waffenliste</a></li>
<li><a href="spray.html">Spray Patterns</a></a></li>
<li><a href="ueber.html">Über</a></a></li>
<li><a href="impressum.html">Impressum</a></li>
</ul>
</div>
<div id="tct">
<p>Kaufbar f&uuml;r: T und CT</p>
</div>
<div id="t">
<p>Kaufbar f&uuml;r: Terroristen</p>
</div>
<div id="ct">
<p>Kaufbar f&uuml;r: Antiterroreinheit</p>
</div>
<div class="bilder">
<img id="awp" src="pictures/awp.PNG">
<img id="scout" src="pictures/scout.PNG">
<img id="dual" src="pictures/dual.PNG">
<img id="p250" src="pictures/p250.PNG">
<img id="deagle" src="pictures/deagle.PNG">
<img id="nova" src="pictures/nova.PNG">
<img id="negev" src="pictures/negev.PNG">
<img id="m249" src="pictures/M249.PNG">
</div>

</div>

</body>
</html>

最佳答案

您可以尝试使用以下 html 和 css 结构,

section #imageGallery li {
display: inline-block;
margin: 20px;
list-style: none;
}

section #imageGallery li div {
width: 280px;
height: 290px;
color: black;
}



#imageGallery .one {
background-image: url(/Images1.jpg);
background-repeat: no-repeat;
background-size: cover;
background-color:#f9f8f5;
}
#imageGallery .two {
background-image: url(/Images2.jpg);
background-repeat: no-repeat;
background-size: cover;
background-color:#f9f8f5;
}
#imageGallery .three {
background-image: url(/Images3.jpg);
background-repeat: no-repeat;
background-size: cover;
background-color:#f9f8f5;
}
#imageGallery .four {
background-image: url(/Images4.jpg);
background-repeat: no-repeat;
background-size: cover;
background-color:#f9f8f5;
}
#imageGallery .five {
background-image: url(/Images5.jpg);
background-repeat: no-repeat;
background-size: cover;
background-color:#f9f8f5;
}
<section>
<ul id="imageGallery">

<li>
<div class="Image one">

</div>
</li>
<li>
<div class="Image two">

</div>
</li>
<li>
<div class="Image three">

</div>
</li>
<li>
<div class="Image four">

</div>
</li>
<li>
<div class="Image five">

</div>
</li>
</ul>
</section>

希望对您有所帮助。

关于html - 图片表现异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41485427/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com