0
我正在尝试将一个图像重叠在另一个图像上,并从中创建一个圆形图像。在选择器之前使用css
<span onclick="someFunction()" id="swatch_123456" class="slider-color-swatches" style="background-image: url(anyImage.png);"></span>
.slider-color-swatches{
position: relative;
width: 28px;
height: 28px;
border-radius: 50%;
cursor: pointer;
display: inline-block;
vertical-align: top;
overflow: hidden;
margin-bottom: 10px;
margin-right: 10px;
}
.slider-color-swatches::before{
content: '';
position: absolute;
background-image: url('anyOtherIamge.pnenter image description hereg');
left: 20%;
width: 100%;
height: 200%;
top: 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
transform: rotate(45deg);
}
Here are the images as to what I want to do and where Iam able to get so far
你可以发布你的代码的小提琴吗? –
试试这个http://tympanus.net/codrops/css_reference/mask-image/ –