PDA

View Full Version : Javascript round circle image



davelf
03-12-2015, 03:21 AM
Hi everyone,

I need a script to round the image to circle shape, i try CSS3:


.round img{width: 118px; height: 118px; -webkit-border-radius: 59px; -moz-border-radius: 59px; border-radius: 59px;}

The problem, if the image is not perfectly rectangular the image layout after css is not proportional.

So may be javascript can help to crop and adjust the image proportion.

Is there any advice for my problem here?

Beverleyh
03-12-2015, 06:27 AM
Is a background-image optional? Take for example the image in my footer here http://fofwebdesign.co.uk/about.php It's the same image used at the top of the page too (it's rectangular)

So, if you use a div that's square, set the pic as a background-image with border-radius:50%;, and maybe adjust the size with background-size:?; like I have, it will hopefully be something you can use.