Skip to content

Instantly share code, notes, and snippets.

@michsch
Created February 19, 2012 18:45
Show Gist options
  • Save michsch/1865123 to your computer and use it in GitHub Desktop.
Save michsch/1865123 to your computer and use it in GitHub Desktop.
img inline margin-bottom bug
/**
* img inline margin-bottom bug
*/
html * { font-size:100.01%; }
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 87.50%; /* 14px */
background: #efefef;
}
.wrapper {
width: 960px;
height: 500px;
padding: 21px;
margin: 0 auto;
background: #fff;
border: 1px solid #444;
}
img {
max-width: 100%;
margin: 0;
padding: 0;
}
p {
margin: 0;
padding: 1.4286em; /* 20px */
line-height: 1.4286em; /* 20px */
border: 1.4286em #444 solid; /* 20px */
}
<!-- content to be placed inside <body>…</body> -->
<div class="wrapper">
<img src="http://dummyimage.com/300x200/cccccc/fff.png" alt="" title="" />
<p>Der Text sollte direkt unter dem Bild stehen und der Text-Rahmen ohne Abstand an das Bild grenzen.</p>
</div>
{"view":"split","prefixfree":"1","page":"html"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment