views:

294

answers:

6

I tried to use jquery.corner.js and it works well in FF but on IE, it adds several breaks and makes the div look "longer". I found several ways of rounding corners using images, but it really gets tedious trying to create images for every corner.

There are some approaches that work only on FF, Opera (and other Mozilla based browsers) but not on IE.

Is there a way to round corners on a div/textbox that works across all browsers without using images?

+5  A: 

No.

But have a look at CSS Rounded Corners In All Browsers (With No Images).

Marcel Korpel
A: 

http://www.curvycorners.net/

It's a javascript library which manually constructs the pixels of your corners out of divs.

Aviral Dasgupta
How has your experience been with curvycorners. Is it cross browser compatible supporting IE6 and Mozilla based browsers?
@user102533: It's quite good. On browsers engines like Webkit and Gecko, which support, native rounded corners, curvycorner uses the native rounded corners. It is cross browser compatible and works in IE6(!). Only problem is if you need to manipulate the DOM (curvycorner's inserted `div`s may cause problems)... otherwise you're good to go
Aviral Dasgupta
@aviraldg - About your comment on manipulating the DOM - the difficulty is in finding an element in the DOM (because curvycorner inserts additional divs)?
@user102533: not if you use getElementById or equivalent, only when you use absolute DOM refs. Also, it may cause problems with CSS that uses child, sibling selectors. And (not confirmed) I guess that many divs do cause an overhead in DOM manipulation... but rounded corners rock, right?
Aviral Dasgupta
@aviraldg - Yes, I admit rounded corners rock :) I guess that's why I am willing to jump through a bunch of hoops just to round the corners. I will try curvycorners and let you know how it goes
+1  A: 

or you can do what everyone will eventually do, stop baby-sitting ie. you want to have rounded corner, set this as standard css rules. user browsing with ie wont benefit from it, unless this is a strong requirements it will simplify your job greatly and maybe help people to switch (or at least update) their browser.

mathroc
Aviral Dasgupta
+1  A: 

Have a look at the border radius CSS3 properties

IE does not support this, so also have a look at SpiffyCorners ( just css )

Keep in mind that not using images (for browsers that do not support the CSS 3 border-radius) means that you will be unable to achieve transparency at the area outside the rounded corner ..

Gaby
Bear in mind that Opera also doesn't support rounded corners yet. And you are able to achieve transparency without images and border-radius: e.g., see http://webdesign.about.com/od/css/a/aa072406.htm (I know, putting a bunch of `<b>`s in your HTML is not semantic, but you have to make compromises to get nice results).
Marcel Korpel
I just read that Opera 10.5 does support rounded corners. And SpiffyCorners uses the same technique as the site I linked to…
Marcel Korpel
A: 

I've looked at several corner-rounding scripts and I have yet to find one that actually works in all of the situations we need it to work in. They don't always play nice once you start manipulating the DOM with your own scripts.

I ultimately went back to images. We round corners via CSS for all compliant browsers, then, if IE, we wrap the elements we want rounded in a div and then absolutely position 4 corner images.

DA
A: 

If you're interested in creating corners in IE then this may be of use - http://css3pie.com/

Sniffer