8 Replies - 2146 Views - Last Post: 02 March 2012 - 08:19 PM

#1 mikelash  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 94
  • Joined: 17-June 11

makeing a picture a circle

Posted 01 March 2012 - 10:14 PM

im trying to make my picture into a circle but it just stays a square

<style>
.circlleDiv {
 width: 10em; height: 10em; 
 -webkit-border-radius: 5em; -moz-border-radius: 5em;
 text-align: center; margin-top: 4.5em;
}
</style>
<div class="circle">
<?php echo subject; ?>
<br/>From
<?php echo from;?>
<br/>
<img height=100px width=100px src="<?php echo 'images/blue flower.jpg'; ?>"/>
</div>



Is This A Good Question/Topic? 0
  • +

Replies To: makeing a picture a circle

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 3872
  • View blog
  • Posts: 11,405
  • Joined: 18-April 07

Re: makeing a picture a circle

Posted 01 March 2012 - 10:36 PM

Your style class name is "circlleDiv" where is the element with that class specified? You have a div named "circle" but no "circlleDiv"

;)
Was This Post Helpful? 0
  • +
  • -

#3 mikelash  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 94
  • Joined: 17-June 11

Re: makeing a picture a circle

Posted 01 March 2012 - 10:52 PM

still dosnt work but i fixed it

<style>
.circlediv {
 width: 10em; height: 10em; 
 -webkit-border-radius: 5em; -moz-border-radius: 5em;
 text-align: center; margin-top: 4.5em;
}
</style>
<div class="circlediv">
<?php echo subject; ?>
<br/>From
<?php echo from;?>
<br/>
<img height=1000px width=1000px src="<?php echo 'images/blue flower.jpg'; ?>"/>
</div>


Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 2888
  • View blog
  • Posts: 7,533
  • Joined: 08-June 10

Re: makeing a picture a circle

Posted 01 March 2012 - 11:07 PM

which browser are you using?
Was This Post Helpful? 0
  • +
  • -

#5 mikelash  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 94
  • Joined: 17-June 11

Re: makeing a picture a circle

Posted 01 March 2012 - 11:10 PM

firefox
Was This Post Helpful? 0
  • +
  • -

#6 mikelash  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 94
  • Joined: 17-June 11

Re: makeing a picture a circle

Posted 01 March 2012 - 11:15 PM

dosnt work in IE either
Was This Post Helpful? 0
  • +
  • -

#7 revolutionx  Icon User is offline

  • D.I.C Head

Reputation: 60
  • View blog
  • Posts: 229
  • Joined: 23-July 09

Re: makeing a picture a circle

Posted 02 March 2012 - 03:03 AM

You can't do that. Well not in the way you're trying to do it.

If you look at: http://jsfiddle.net/mYm5p/ it's applying the border radius to the div and not to the image.

Have a look at the following for workarounds:

http://stackoverflow...-crop-out-image

http://stick.gk2.sk/...ers-using-css3/
Was This Post Helpful? 0
  • +
  • -

#8 mikelash  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 94
  • Joined: 17-June 11

Re: makeing a picture a circle

Posted 02 March 2012 - 01:29 PM

none of those seem to solve my problem, thanks though any other suggestions?
Was This Post Helpful? 0
  • +
  • -

#9 exiles.prx  Icon User is offline

  • D.I.C Head

Reputation: 64
  • View blog
  • Posts: 224
  • Joined: 22-November 10

Re: makeing a picture a circle

Posted 02 March 2012 - 08:19 PM

If you set your div to the width and height of 100px, use a border radius of 100px and you will have your circle.

BTW, it doesn't work in IE because IE does not use -moz or -webkit. You must use border-radius for IE.

This post has been edited by exiles.prx: 02 March 2012 - 08:20 PM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1