Skip to content

Instantly share code, notes, and snippets.

@blaine
Created January 30, 2013 12:32
Show Gist options
  • Save blaine/4672979 to your computer and use it in GitHub Desktop.
Save blaine/4672979 to your computer and use it in GitHub Desktop.
This is an obscure and totally weird bug to do with contenteditable rendering when a negative text-indent is applied. Basically, the insertion point only appears when the contenteditable element has content. When it's empty, the insertion point is empty.
<html>
<head>
<style>
.container {
width: 50px;
height: 1em;
position: absolute;
left: 500px;
top: 200px;
background: yellow;
}
.editable {
text-indent: -250px;
}
</style>
</head>
<body>
<div class="container">
<div class="editable" contenteditable="true"></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment