Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image to be displayed as a circled Image using css

Tags:

html

css

Here's my code - This works in chrome, firefox and safari .. I have tested it on Windows 7 However in IE 8 and Opera browser the following code is not working and instead of showing a circled image I am getting Image in square form

<div id="hotspot-img1-0">
  <ul>
    <img class="proimg" src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/276311_100002617687873_1118195351_n.jpg" title="web" style="width:100px;height:100px;background:#fff;border:2px solid #ccc;-moz-border-radius:52px;-webkit-border-radius:52px;">
  </ul>
</div>

CSS

#hotspot-img1-0{
top: 570px; 
left: 67px; 
height: 104px; 
width: 104px; 
border-top-left-radius: 52px; 
border-top-right-radius: 52px; 
border-bottom-right-radius: 52px; 
border-bottom-left-radius: 52px; 
box-shadow: 0px 2px 5px 0px; 
border-top-color: rgb(255, 255, 255); 
border-left-color: rgb(255, 255, 255); 
border-right-color: rgb(255, 255, 255); 
border-bottom-color: rgb(255, 255, 255); 
border-top-width: 2px; 
border-left-width: 2px; 
border-right-width: 2px; 
border-bottom-width: 2px; 
border-top-style: solid; 
border-left-style: solid; 
border-right-style: solid; 
border-bottom-style: solid
}
like image 956
Sandhurst Avatar asked Oct 13 '11 04:10

Sandhurst


1 Answers

@Sandhurst; first thing bad markup write like this:

<div>
  <ul>
    <li>
       <img class="proimg" src="http://profile.ak.fbcdn.net/hprofile-ak-snc4/276311_100002617687873_1118195351_n.jpg" title="web">
    </li>
  </ul>
</div>

& Answer for the question use background-image instead of img :

li{
 background:url(image.jpg) no-repeat;
 -moz-border-radius:52px;
 -webkit-border-radius:52px;
 border-radius:52px;
width:200px;
height:200px;
}
like image 84
sandeep Avatar answered Nov 06 '22 18:11

sandeep