Reputation: 389
I'm trying to get the Facebook logo next to the photo of the store, but it just doesn't work..
Here is some of my HTML & CSS code
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;
}
If you want more information, let me know please :)
Upvotes: 4
Views: 102
Reputation: 45
Remove float from your body, and move the facebook image above your main image.
body {
text-align: center;
margin-left: 18%;
background: #F2F2F2;
}
Fiddle at: http://jsfiddle.net/6Pkz5/
Upvotes: 1
Reputation: 15838
move #facebook div ABOVE the image, now it's floating right after the image so it ends up below it
it's not clear the expected result anyway, maybe you need some margins or something else
Upvotes: 1