Skip to content

Instantly share code, notes, and snippets.

@Chun-Yang
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save Chun-Yang/6c687c72be16b324e2db to your computer and use it in GitHub Desktop.

Select an option

Save Chun-Yang/6c687c72be16b324e2db to your computer and use it in GitHub Desktop.
CSS inline image icon at right
https://jsfiddle.net/LfgnLz91/
<div class="wrapper wrapper-icon-right icon-check-right">
<input type="text" >
</div>
.wrapper {
width: 100%;
box-sizing: border-box;
padding-right: 50px;
height: 50px;
position: relative;
background-color: red;
}
.wrapper:after {
content: ' ';
height: 100%;
width: 50px;
display: block;
position: absolute;
right:0;
top: 0;
background-repeat: no-repeat;
background-size: 20px;
background-position: center center;
background-color: blue;
}
.icon-check-right:after {
background-image: url('http://icons.iconarchive.com/icons/mazenl77/I-like-buttons-3a/512/Cute-Ball-Go-icon.png');
}
.wrapper input {
width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment