我试图在商店的照片旁边显示 Facebook Logo ,但它不起作用..
这是我的一些 HTML 和 CSS 代码
HTML
<!DOCTYPE html>
<html>
<head>
<title>Menz store</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="Main.css"/>
</head>
<body>
<header>
<img src="images/MenzHeader2.jpg" alt="De logo van Menz"/>
</header>
<table>
<h1>Locaties van de Men<span class="menz">z</span> store's</h1>
<tr>
<th><h3>Stad:</h3></th>
<th></th>
<th><h2>Antwerpen</h2></th>
<th></th>
<th><h2>Schaarbeek</h2></th>
</tr>
<tr>
<td>Straat:</td>
<td></td>
<td>Offereande 9 & 71</td>
<td></td>
<td>Chaussée de waterloo</td>
</tr>
</table>
</br>
<img src="images/MenzStore.jpg" alt="Menz winkel" class="Menz1"/>
<div id="TwitterAndInsta">
<!---->
<a href="https://twitter.com/MenzStore">
<img src="images/Twitter2.jpg" alt="Logo van twitter" id="twitterLogo">
</a>
<a href="http://instagram.com/menzstore">
<img src="images/instagram.png" alt="Logo van Instagram" id="instagramlogo">
</a>
</div>
<div id="Facebook">
<a href="https://www.facebook.com/menzstore">
<img src="images/Facebook.jpg" alt="Logo van Facebook"/></a>
</div>
</body>
</html>
CSS
body {
text-align: center;
float: left;
margin-left: 18%;
background: #F2F2F2;
}
header {
height:305px;
width: 800px;
margin-top: 5%;
margin-bottom: -10%;
margin-left: 10%;
}
table {
margin-left: 27%;
width: 400px;
line-height: 0px;
}
img.menz1 {
display: block;
margin-right: auto;
margin-left: auto;
}
span.menz {
color: darkblue;
}
div#TwitterAndInsta a img {
width:250px;
height: 250px;
float: left;
margin-left: -49%;
margin-top:4444444444444444444%;
position: fixed;
}
div#TwitterAndInsta a img#twitterLogo {
margin-top:-43%;
}
div#TwitterAndInsta a img#instagramlogo {
margin-top: -63%;
}
div#Facebook img {
height: 250px;
width:250px;
margin-right: -20%;
float: right;
}
如果您想了解更多信息,请告诉我:)
最佳答案
将#facebook div 移动到图片上方,现在它漂浮在图片后面,所以它最终在图片下方
反正预期的结果还不清楚,也许你需要一些边距或者别的什么
关于html - 无法将图像放在其他图像旁边,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23342056/