I am having some problems with the code in the book as well.
I did notice a couple of things in your code.
I did not have this commented out.
/*.box h2 {
background: transparent url(box-top.gif) no-repeat top left;
margin: -10px -10px 0 10px;*/
}
you have an extra semi colon on the margin-top property after the first 0
.box > h2 {
background-image: none;
margin-top: 0; 0 auto 0;
padding: 0;
}
here is the way I translted the code:
/* styles for rounded corner fixed width box */
#sidebar
{
width: 200px;
}
.box
{
background-color: #f5ece3;
border: 2px solid #eld4c0;
padding: 8px;
}
.box:before
{
content: url(box-top.gif);
display: block;
line-height: 0.1;
margin: 0 -10px -10px -10px;
}
.box:after
{
clear: both;
content: url(box-btm.gif);
display: block;
line-height: 0.1;
margin: 0 -10px -10px -10px;
}
.box h2
{
margin-top: 0;
}
/* added for explorer */
.box h2
{
background: transparent url(box-top.gif) no-repeat top left;
margin: -10px -10px auto -10px;
padding: 10px 10px 0 10px;
}
/* sets the h2 back from explorer hack using child selector > */
.box > h2
{
background-image: none;
margin: 0 0 auto 0;
padding: 0;
}
if you get it working let me know, I tried in IE and it doesn't work
|