Forum Moderators: not2easy
Such a problem would be a piece of cake if I were coding for the old IE box model but with the standard...I just can't figure it out. What I need is a box whose height (as defined by W3C) is 10em - 4px. (In the old IE box model, it would be 10em tall with a border of 2px.)
Note that I can't use "height: 100%; border: 2px solid;" because 'inner' will then take up more than 10em. (To be specific: 10em + 4px.)
Here's the best I've come up with so far...they're both horribly hacky...
1. Create four divs within 'outer.' Each div has its background set to a single pixel square, on repeat. One div is given the width 100% and height 2px and absolutely positioned top left. This forms a horizontal line that functions as the top border. The other three divs are treated similarly and form the left, right, and bottom borders. Unfortunately (in addition to being a horribly hacked way of doing this), the top and bottom border are displayed incorrectly in IE.
2. Create a table (gasp!) within 'outer.' Set its height and width to 100% and its border to 2px. The problem with this one is that the right border comes up 1 pixel short in Mozilla browsers (FF, NN).
I really hope somebody can help me out with this. I've spent way too much time on it and it's driving me batty. Thanks a lot in advance for any help you can give.
matthew
<div style="width:10em; height:10em; background-color:gray">
<div style="width:9.9em; height:9.9em; margin:1em; border:solid 2px black; background-color:blue;"></div>
</div>
So come on, people, take this challenge on!