>
- example
=======
if i place that div(rectangle) over any other element(say an image).the image should be visible only through the circle inside of that div(rectangle).
>
=======
if i place that div(rectangle) over any other element(say an image).the image should be visible only through the circle inside of that div(rectangle).
As Muhammad commented your question is a little vague (and not very well formatted), but it sounds like you're after a clipping "mask" layer using the clip-path
css rule?
Here's a codepend showcasing the CSS clip-path - http://codepen.io/chriscoyier/pen/02e4ebad4c8d3beeb0dc4781a811a37c
And heres the corresponding article - https://css-tricks.com/clipping-masking-css/
The only other interpretation of your question that I can think of is a basic border radius rule on the div with overflow set to hidden.
.rectangle {
background-image: url(yourimage.jpg);
border-radius: 100px;
width: 100px;
height: 100px;
}
EDIT: As you've now stated your intentions in the comments section. You can achieve a clipping mask by using pseudo elements on your div element like so:
.rectangle {
position: relative;
}
.rectangle:after {
content: "";
position: absolute;
left: 50%;
top: 50%;
transform: translate3d(-50%,-50%,0);
width: 30px;
height: 30px;
border-radius: 30px;
background-image: url(yourimage.jpg);
background-size: 200px 100px;
}