CSS masks available

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.

+3
source share
2 answers

You just need to work with the properties border-radiusand overflow:hiddenin the container. Like this:

.circle {
  width:300px;
  height:300px;
  border-radius:50%;
  overflow:hidden;
}

Check it out D'oh Demo http://jsfiddle.net/p57fs/

+4
source

CSS border-radius , , div, "" .

1

border-radius . . HTML, ( ).

2

border-radius div. . . .

, border-radius (. ). , , ,

0

All Articles