The problem is there's a <form> element between #textbox and #send. Since the form doesn't have an explicit height, it's given a height of "auto", so #send's percent height also becomes "auto". Set an explicit height on the <form> to fix:
Code:
#textbox * {
height: 100%;
}
Also, is there a better way to make the page elements line up? I am aware that the padding, border and margin add to an elements total width (why?),
If by "total width", you're referring to the box width,
box dimensions are defined by the W3C box model. The
element width is only the
width of the content in the W3C box model. In the old IE box model (used in IE6+ quirks mode and through IE 5.5), the element width included the border & padding. I'm not certain if that explains away your confusion.
and the percent widths cannot be a decimal. That makes lining up the page elements very difficult when you want to have a 1px border or a padding smaller than 1% of the page. You can see where I had trouble making the elements line up. What can I do about that?
This is a common complaint about CSS: that you can't easily combine different units. One solution (not always applicable) is to use negative margins with the other unit. Another is to add additional wrapper elements, using one unit on the wrappers and the other unit on the wrapped. Many find this distasteful, as the extra elements are present for purely presentational purposes (though they themselves aren't presentational elements).
Here's a sample using the two techniques. The style shows only what's added or changed from your main.css.
Code:
.inner, #textbox button {
position: absolute;
left: 0;
right: 0;
}
.inner {
border: 1px solid black;
padding: 10px;
top: 0px;
bottom: 0px;
}
#online {
...
width: 15%;
position: relative;
}
#chat {
...
position: relative;
}
#textbox * {
height: 100%;
}
#textbox .frame {
position: relative;
float: left;
}
#textbox textarea {
width: 90%;
margin-right: -1px;
float: left;
}
#textbox #sendFrame {
width: 10%;
}
#textbox #send {
left: 5px;
right: 0;
background-color: #CCC;
border: 1px solid black;
display: table-cell;
text-align: center;
cursor: pointer;
}
HTML:
<div id="wrapper">
<div id="online">
<div class="inner">
<span style="color: red">Twinkie</span><br />
<span style="color: green">Calistoy</span><br />
<span style="color: blue">Sharky</span><br />
</div>
</div>
<div id="chat">
<div class="inner">
<span style="color: red">Twinkie</span>: I justed wanted to say something not very important.<br />
<span style="color: green">Calistoy</span>: What I as about to say was equally unimportant.<br />
<span style="color: blue">Sharkey</span>: I was about to interrupt you.<br />
</div>
</div>
<div id="textbox">
<form method="post" action="#" name="user">
<textarea name="message"></textarea>
<span id="sendFrame" class="frame">
<button id="send">Send</button>
</span>
</form>
</div>
</div>
The various methods of mixing units can still suffer from rounding errors, which are visible as you resize the window.