zenho99
zenho99

Reputation: 23

CSS - div inside div, no background color in IE

I have this simple layout in HTML:

<body>
    <div class="container">
        <p class="title1">Title 1</p>
        <div class="content">
            <p class="title2">Title 2</p>
        </div>
    </div>
</body>

And the following CSS:

body {
    background-image:url(masthead.gif);
    margin: 0;
    padding: 0;
}

.container {
    position:absolute;
    width: 960px;
    height:600px;
    left: 50%;
    margin-left: -480px;
    margin-top: -300px;
    top: 50%;
    -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    border: 1px solid #81a1b7;
    zoom: 100%;
    background-color: rgba(117,161,180,0.5);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f75A1B4,endColorstr=#7f75A1B4);
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#7f75A1B4,endColorstr=#7f75A1B4)";
}

.content {
    background-color: rgba(255,255,255,0.8);
    border-radius: 15px 15px 15px 15px; 
    padding: 10px 0;
    margin: 15px;
    -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    height: 500px;  
}

.title1 {
    font-family:Arial, Helvetica, sans-serif;
    font-size:20px;
    color:#FFF;
    margin-top: 15px;
}
.title2 {
    font-family:Arial, Helvetica, sans-serif;
    font-size:18px;
    color:#000;
    margin-top: 0px;
}

I was expecting to see a white colored background and rounded corners in the inside "content" div... I got this working in Firefox and Chrome, but there is no background color in Internet Explorer. What am I doing wrong?

View the code on JsFiddle

Upvotes: 2

Views: 1787

Answers (1)

Simon Arnold
Simon Arnold

Reputation: 16177

IE8 and lower doesn't support rgba and border-radius.
So .content {background-color: rgba(255,255,255,0.8);} won't show anything in those browsers :S

You will need to use a hex color or a png instead.

Upvotes: 1

Related Questions