wood_tah
09-10-2008, 11:48 AM
Can anyone help me? I can't figure out how to get IE (6 and 7) to pick up a background color in an element via inheritance, and show that color above a border on the element that is behind it. The only way I have been successful is to explicitly specify the background color on the desired element. However, I want the behavior to be the same, but to pick up whatever color is specified by the body (or some other element containing the target element), because the background color can changed based on user preferences.
If you take the code below and open it in Firefox, it does what I expect (tested in FF2, would expect same behavior for FF3). However, if you open this in IE6 or IE7, you can still see the border behind the filterTitle element.
Any help with this will be greatly appreciated!
<html>
<head>
<title>CSS Test</title>
<style type="text/css">
body {
background-color: pink;
color: black;
}
*:first-child+html .searchResultsContainer {
height: 1%;
}
*html .searchResultsContainer {
height:1%;
}
.searchResultsContainer {
background: inherit;
}
.filterTitle,
.searchResultTitle {
font-size:13px;
font-weight:bold;
}
.filterTitle { /* mainHeading styles combined with searchResultTitle */
/*background-color:white;*/ /* when this is used, works as expected in IE */
background: inherit;
padding: 0 6px;
float: left;
margin-top: -10px;
border: 1px solid #000; /* #AFB4C3 */
}
#filterCriteria {
border: 1px solid #000; /* #AFB4C3 */
padding: 0 10px 10px 10px;
margin-bottom: 14px;
background: inherit;
}
#filterCriteria table {
clear: both;
}
#filterCriteriaContainer,
.divLblContainer {
padding: 10px 0 0 0;
}
</style>
</head>
<body>
<div class="searchResultsContainer" id="filterCriteriaContainer">
<div id="filterCriteria" class="results">
<div class="filterTitle">Filter Criteria</div>
<table>
<tr><td>Dummy table cell text</td></tr>
</table>
<p>Some dummy content for the area.</p>
</div> <!-- end filterCriteria -->
</div>
</body>
</html>
If you take the code below and open it in Firefox, it does what I expect (tested in FF2, would expect same behavior for FF3). However, if you open this in IE6 or IE7, you can still see the border behind the filterTitle element.
Any help with this will be greatly appreciated!
<html>
<head>
<title>CSS Test</title>
<style type="text/css">
body {
background-color: pink;
color: black;
}
*:first-child+html .searchResultsContainer {
height: 1%;
}
*html .searchResultsContainer {
height:1%;
}
.searchResultsContainer {
background: inherit;
}
.filterTitle,
.searchResultTitle {
font-size:13px;
font-weight:bold;
}
.filterTitle { /* mainHeading styles combined with searchResultTitle */
/*background-color:white;*/ /* when this is used, works as expected in IE */
background: inherit;
padding: 0 6px;
float: left;
margin-top: -10px;
border: 1px solid #000; /* #AFB4C3 */
}
#filterCriteria {
border: 1px solid #000; /* #AFB4C3 */
padding: 0 10px 10px 10px;
margin-bottom: 14px;
background: inherit;
}
#filterCriteria table {
clear: both;
}
#filterCriteriaContainer,
.divLblContainer {
padding: 10px 0 0 0;
}
</style>
</head>
<body>
<div class="searchResultsContainer" id="filterCriteriaContainer">
<div id="filterCriteria" class="results">
<div class="filterTitle">Filter Criteria</div>
<table>
<tr><td>Dummy table cell text</td></tr>
</table>
<p>Some dummy content for the area.</p>
</div> <!-- end filterCriteria -->
</div>
</body>
</html>