vinzenzb February 2016

HTML automatically adding padding?

My problem with this HTML script is that I'm always get a padding-bottom in each div. Can anybody see why?

 * {
   margin: 0px;
   padding: 0px;
 }
 body {
   width="1920px";
   height="1080px";
 }
<!doctype html>
<html>

<body>
  <div>
    <img src="images/header.jpg">
  </div>
  <div>
    <img src="images/stuecke.jpg">
  </div>
  <div>
    <img src="images/termine.jpg">
  </div>
  <div>
    <img src="images/team.jpg">
  </div>
  <div>
    <img src="images/wo.jpg">
  </div>
</body>

</html>

Answers


SLaks February 2016

<img> is an inline element, so it gets spacing from the line-height.

Make them display: block to prevent that.

Post Status

Asked in February 2016
Viewed 3,419 times
Voted 8
Answered 1 times

Search




Leave an answer