views:

608

answers:

5

Hi,

My css is not working with Iexplorer, can someone explain me why this isn't working?

The HTML

<div class="myBox"> Content  <div>

The CSS:

.myBox {
    margin: 0.0in auto;
    color: #FFF;

    width: 450px;
    height:450px;
    padding: 12px;
    text-align: left;
    background-color: #444141;
    border: 0px solid #4e4b4b;

    /* Do rounding (native in Firefox and Safari) */
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
}

.myBox h2 {
    color:#f57f20

}
A: 

Because IE does not support custom Mozilla or WebKit properties.

An option could have been using CSS3 browser-independent round corner properties, but it is not yet widely implemented across major browsers. So for now you'll have to stick to images if you want cross-browser compatibility or function with JavaScript disabled.

Developer Art
The only suggestion would be using image based corners?
Chris
Yes, either image-based or some JavaScript trickery.
Developer Art
+1  A: 

IE doesn't support CSS3 rounded corners, I'd suggest a fallback to using PNG images.

Khal Weir
+2  A: 

Webkit is for well, webkit (Safari, Chrome). Moz is for mozilla. Why would it work in IE?

Use this jQuery Plugin for a cross-browser solution.

Nimbuz
great answer, really something I can work with
Chris
I just answered your question. You didn't ask for a solution, did you? Well, just gave you a solution too.
Nimbuz
Great sollution, it's working like a charm :)
Chris
That web site is hideous.
James Jones
A: 

Just use the CSS3 property border-radius. Sure, it probably won't work until IE9, which goes back to the age old question...

Do web sites need to look exactly the same in every browser?

James Jones
I say yes! i like the website idea though. I'm sure that website looks the same in every browser though ;-)
Chris
Actually, that site looks very different between Chrome, IE7, and IE8. Only chrome can generate the shadow below the text. IE7 is slightly off-center and shows the scroll bar. But if you only ever viewed it in 1 browser, you wouldn't be able to know there was a difference. So you get the point :)
James Jones
A: 

You should use htc file to curve corners in IE6+. In IE9 the CSS3 declarations will work. How to use htc file to curve corners you can find here http://starikovs.com/2010/08/24/css3-rounded-corners/.

Vacheslav