jQuery .css border-radius does not work with position:absolute?

狂风中的少年 提交于 2019-12-08 07:56:42

问题


I have a series of images that makes a gallery-type of display. I use jQuery to make them round with a random diameter for each.

It works perfectly fine, but then I need to place them correctly. The problem is that giving the <div> that contains the image a position:absolute (or any kind of position) turns the <div> back into a square.

Is there a fix? Am I doing something wrong?

I made a Fiddle to make the code clear.


回答1:


Putting a wrapper <div> around each image, seems to solve it...

http://jsfiddle.net/szGnh/21/



来源:https://stackoverflow.com/questions/7030368/jquery-css-border-radius-does-not-work-with-positionabsolute

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!