Hi, I've got a containing div (div Z). Inside the containing div are 3 content divs (divs A, B, and C). Div A has text "short" and is floated left, div B has text "whatever", and div C has text "long long long" and is floated right.
My goal is to have div B centered inside of div Z. Currently I am stuck with div B being centered between divs A and C. How can I accomplish this?
HTML:
<div id='Z'>
<div id='A'>short</div>
<div id='C'>long long long</div>
<div id='B'>whatever</div>
</div>
CSS:
#Z {
text-align: center;
background: #333;
}
#A {
display: inline-block;
float: left;
border: 1px solid yellow;
}
#B {
display: block;
border: 2px solid blue;
}
#C {
display: inline-block;
float: right;
border: 1px solid red;
}
Sorry for the unreadability. I can't seem to figure out how to get the forum to display tabs or spaces.
Screeshot of current behavior [ploader.net]
Screeshot of desired behavior [ploader.net]
Can someone tell me what I'm doing wrong? My doctype is XHTML 1.0 Transitional.
Thanks,
== Matt