I seem to have forgotten how to do this- I have two buttons [leftBtn] [rightBtn] which I have centered [leftBtn] and floated:right for [rightBtn]. Once I float:right the [leftBtn] button which is centered shifts to the left a bit and no longer is in its centered position. Is there a method to keep the the [leftBtn] button centered while floating:right [rightBtn]?
Thank you. The context is a simple dialog box with a fixed width (500px by 400px) the two buttons are in the footer area. Your example is what I have too but it does not solve the issue of having [leftBtn] centered. And [rightBtn] absolutely positioned to the right. When you float the [rightBtn] the other button actually shifts its location thus is not in its original centered location.
I have attached the screen shot illustrating what I am experiencing. But I think I answered my own question- I can absolutely position the [rightBtn] and that would solve it I believe. Sorry, I would be quicker but there are three computers connected for 30 developers
Yes, position: absolute for the right button is an option. Or, if the width of the container is fixed, you could perhaps wrap divs around each button, float those divs, and place the bottons to the right of each div, and give the first div a width that makes the button sit in the center. I guess that’s not the most accurate method, though—especially as the button may change shape from browser to browser.