Hey, I'm trying to position three buttons in a container div: a Previous, a Home and a Next button. The Home button should always go in the middle, while the Previous and Next buttons should go at the sides, with equal spacing between them and the Home button.
Basically, I want it to look like this:
I've tried with floats, but that made the Home button dependant of the Previous button, making the spacing between the Previous and Home button and between the Home and Next button not equal. Right now, I've tried this:Code:---------------------------- | ---------------------- | | | Pr Ho Ne | | | ---------------------- | ----------------------------
This works like a charm, except for one thing... the position: absolute; is relative to the page. If I could get that relative to the div it's contained in, it'd work like a charm. I do realize this kind of beats the purpose of position: absolute, thoughCode:.previous { width: 90px; height: 20px; background-color: #408080; border: 1px solid #008040; text-align: center; position:absolute; left: 10px; } .home { width: 90px; height: 20px; position: absolute; background-color: #408080; border: 1px solid #008040; text-align: center; margin-left: auto; margin-right: auto; } .next { width: 90px; height: 20px; right: 10px; background-color: #408080; border: 1px solid #008040; text-align: center; position: absolute; }Any help'd be greatly appreciated. Thanks in advance
![]()



Any help'd be greatly appreciated. Thanks in advance




Bookmarks