Skip to content

Instantly share code, notes, and snippets.

@benknight
Created October 19, 2012 23:56
Show Gist options
  • Save benknight/3921355 to your computer and use it in GitHub Desktop.
Save benknight/3921355 to your computer and use it in GitHub Desktop.
Chrome inline-block with floated element page zoom bug
/**
* Chrome inline-block with floated element page zoom bug
*
* Problem: Zooming the page causes text to break to next line with black square above at certain zoom levels.
* This behavior isn't reproduced in other Webkit browsers, namely Safari.
*
* Temporary solutions:
* 1) Setting white-space: no-wrap on the outer <div>
* 2) Using display: inline-block on <i> instead of float: left.
*/
div {
display: inline-block;
border: 1px solid black;
font: large sans-serif;
}
i {
display: block;
float: left;
width: 10px;
height: 10px;
margin: 5px 5px 0 0;
background: black;
}
<div><i></i>Test</div>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment