我希望第二個邊框正好在電話圖像的下面,就像Gmail下面的那個。我不知道我做錯了什么,但我無法調整它。非常感謝您的幫助:)
.b1 {
border: 1px solid rgba(255, 0, 0, 0.464);
height: 280px;
width: 224px;
margin-left: 18%;
margin-right: 2%;
margin-top: 1.2%;
float: left;
}
.nav {
background-color: crimson;
height: 60px;
display: flex;
}
<div class="nav">
<a href="movie.html"> <img style=" margin-left: 10px; margin-top: 12px; float: left; " src="images/back.png" width="30px" height="30px">
</a>
<h1 style="margin-left: 20px; margin-top: 5px; font-family:Verdana; color: white; ">CineScape</h1>
</div>
<img style="height: 60px; width: 60px; margin-left: 24%; margin-top: 12%; display: inline;" src="images/gmail.png">
<img style="height: 60px; width: 60px; margin-left: 20%; margin-top: 12%; display: inline;" src="images/telephone.png">
<img style="height: 60px; width: 60px; margin-left: 20%; margin-top: 12%; display: inline; " src="images/linkedin.png">
<br>
<div class="b1">
<p style="color: white;padding-left: 9px;padding-top: 4%; font-family: Verdana ;"><b> cinescape@gmail.com </b>
</p>
</div>
<div class="b1">
<p style="color: white;padding-left: 9px;padding-top: 4%; font-family: Verdana ;"><b>042-8382999
</b>
</p>
</div>
您給出了左邊距“%”
<img style="height: 60px; width: 60px; margin-left: 24%; margin-top: 12%; display: inline;" src="images/gmail.png">
所以在不同的寬度下不能正常工作 你可以用那個來代替。
<html>
<head>
<link rel="stylesheet" href="cont.css">
<style>
.nav{
background-color: crimson;
height: 60px;
display: flex;
}
p {
border: 1px solid rgba(255, 0, 0, 0.464);
height: 280px;
width: 224px;
}
.container {
display: flex;
flex-direction: row;
justify-content: center;
margin-top:1.2%;
gap:40px;
}
.b1 {
display:flex;
flex-direction:column;
align-items: center;
}
b {
color:black;
}
</style>
<div class="nav">
<a href="movie.html" > <img style=" margin-left: 10px; margin-top: 12px; float: left; " src="images/back.png" width="30px" height="30px" >
</a>
<h1 style="margin-left: 20px; margin-top: 5px; font-family:Verdana; color: white; " >CineScape</h1>
</div>
</head>
<body>
<div class="container">
<div class="b1">
<img style="height: 60px; width: 60px;" src="images/gmail.png">
<p style="color: white;padding-left: 9px;padding-top: 4%; font-family: Verdana ;">
<b> cinescape@gmail.com </b>
</p>
</div>
<div class="b1">
<img style="height: 60px; width: 60px;" src="images/telephone.png">
<p style="color: white;padding-left: 9px;padding-top: 4%; font-family: Verdana ;">
<b> 042-8382999 </b>
</p>
</div>
<div class="b1">
<img style="height: 60px; width: 60px;" src="images/linkedin.png">
</div>
</div>
</body>
</html>