Skip to content

Instantly share code, notes, and snippets.

@DeviaVir
Created October 6, 2012 18:47
Show Gist options
  • Save DeviaVir/3845768 to your computer and use it in GitHub Desktop.
Save DeviaVir/3845768 to your computer and use it in GitHub Desktop.
Playing with pointer-events
/**
* Playing with pointer-events
*/
html, body {
background: #f4f4f4;
}
.form {
width: auto;
height: auto;
position: relative;
margin: 100px 50px 25px
}
input {
padding: 15px 20px;
width: 100%;
box-sizing: border-box;
border: 1px solid #ccc;
box-shadow: 0 0 20px -5px rgba(0,0,0,.3);
font-size: 20px;
}
span {
position: absolute;
right: 15px;
top: 18px;
padding: 10px;
border-radius: 50%;
background: #555;
/* Have clicks go to the input */
pointer-events: none;
/* But show a cursor when hovering (not a text cursor) */
cursor: pointer;
}
<!-- content to be placed inside <body>…</body> -->
<div class=form>
<input type=text />
<span class=color></span>
</form>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment