I’m trying to create a basic panel like container with a title bar. Inside the title bar there should be a title floated to the left side and a few buttons floated to the right side. I’m having a problem trying to get my divs aligned correctly.
I’m having a problem trying to get my divs aligned correctly.
Hi,
It looks like your .panel_header was not enclosing the floated .panel_options div. Setting overflow:hidden; on .panel_header will force it to enclose it’s child floats.
Not only that but your h1 is a block level and it fills the full available width, when the right float comes after that h1 in the markup it sits below the h1.
(Note: I’m talking about the h1 title above, not your button h1. Just to make things a little clearer, that button should not be an h1 either.
Now if you float your h1 title to the left and your button to the right I think it will do what you want. It looks like you can eliminate some of those divs too, see if this code below works for you.