I am working on aligning a jQuery UI slider and two buttons vertically, and I want to center the slider next to the buttons.
To better illustrate what I mean, I have created a demo in this fiddle: http://jsfiddle.net/cKv34/
#button1, #button2 {
float: right;
}
#wrapper {
overflow: hidden;
display: block;
padding: 10px;
}
#slider {
float: left;
width: 100%;
}
...
<button id="button1">Button1</button>
<button id="button2">Button2</button>
<span id="wrapper"><div id="slider"></div></span>
Although I've made progress on this layout, I am currently using a fixed padding value for the slider's wrapper span element, which is not ideal for me.
Does anyone know of a method to center these elements without relying on fixed pixel values?
I welcome any suggestions since I'm relatively new to CSS (I found inspiration for my fiddle from this answer).