views:

286

answers:

1

Consider this simple markup:

<body>
 <div style="border: 2px solid navy; position:absolute; width:100%; height:100%">
 </div>
</body>

In the browsers I've tested (Firefox and Chrome) the right and the bottom parts of the border seem to lie outside the window area, since they are not visible. How should I fix my markup or stylesheet so that the div's border is completely visible while the div occupies the whole available area (i.e. its sizes are 100%/100% or equivalent)?

+2  A: 
James Skidmore
Asker's sample code and question are about setting a DIV.
random
Thanks e.c.ho, I added some more code to directly answer his question.
James Skidmore
@Jaffar, look at the end of the post for a `div` solution.
James Skidmore
@Jaffar, take a look at the last example now.
James Skidmore