Reputation: 599
I'm just messing around with basic HTML and CSS and ran into this problem. I have two images directly on top of each other that appear from the top of the screen and down. I don't understand why there is a white line seperating the two images. I think it's connected to the first image because the second image has the same spacing but smaller, if you highlite the image.
HTML:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Christdentity</title>
<link rel="stylesheet" href="style.css">
<script type="text/javascript"></script>
</head>
<body>
<img class="logo-banner" src="images/christd_logo_banner.jpg">
<img class="logo-banner-dark" src="images/christd_logo_banner2.jpg">
</body>
</html>
CSS:
body {
margin: 0;
}
img.logo-banner {
width: 100%;
min-width: 600px;
height: 40px;
padding-bottom: 0;
}
img.logo-banner-dark {
width: 100%;
min-width: 600px;
height: 20px;
padding-bottom: 0;
}
jsfiddle: http://jsfiddle.net/Sederu/nQe7F/
Upvotes: 0
Views: 129
Reputation: 59779
Add display: block;
to the <img>
as they're replaced inline elements by default
img.logo-banner {
display: block;
width: 100%;
min-width: 600px;
height: 40px;
padding-bottom: 0;
}
img.logo-banner-dark {
display: block;
width: 100%;
min-width: 600px;
height: 20px;
padding-bottom: 0;
}
Also take a look at: Eliminate vertical whitespace between images
Upvotes: 4