I am trying to understand the basics of CSS layout and have some problems with a page that is too tall when adding borders.
Here is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <link rel="stylesheet" type="text/css" href="KKF_00005.css"> <title>KKF 5: Border coping</title> </head> <body> <div class="links_aussen"> <div class="innen">Rechts</div> </div> <div class="mitte_aussen"> <div class="innen">Mitte</div> </div> <div class="rechts_aussen"> <div class="innen">Links</div> </div> </body> </html>
I use the following stylesheet:
@CHARSET "ISO-8859-1"; * { height: 100%; margin: 0; padding: 0; } html,body { background-color: grey; width: 100%; } .innen { border: 1px solid black; } .links_aussen { float: left; background-color: green; width: 33%; height: 100%; } .mitte_aussen { float: left; background-color: yellow; height: 100%; width: 34%; } .rechts_aussen { float: left; background-color: red; height: 100%; width: 33%; }
And here is jsFiddle
My problem is that this code gives me a nice 100% layout horizontally, but creates a vertical scrollbar. I would like to have scrollbars, but also see borders (so that overflow: hidden will not help me with this, I think) - checked in Chrome and Firefox.
So: How can I tell my small browser that it should remove 2 pixels from the height so that I have borders and scrollbars?
Thanks in advance for any ideas and answers Andre
source share