Is it possible to have a mask in CSS
I was wondering if I can use a mask to do something like this.
http://www.ttmt.org.uk/face.png
It would be nice if I could do it something like this.
<div class="circle"> <img src="face.jpg" alt="" /> </div>
If I can't do it this way, this is the only way to do it in Photoshop, and then have a flat square image with a face inside the circle.
You just need to work with the properties border-radiusand overflow:hiddenin the container. Like this:
border-radius
overflow:hidden
.circle { width:300px; height:300px; border-radius:50%; overflow:hidden; }
Check it out D'oh Demo http://jsfiddle.net/p57fs/
CSS border-radius , , div, "" .
border-radius . . HTML, ( ).
border-radius div. . . .
, border-radius (. ). , , ,