I have a jQuery UI slider and two buttons next to each other and I want to center the slider vertically beside the buttons.
I've created a fiddle that shows what I want to achieve: 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>
I'm almost there, but right now I use a fixed padding on the slider's wrapper span element, which bugs me.
Is there a way to achieve the centering without using constant values?
I'm open to any suggestions as I'm a CSS newbie (I've based my fiddle upon this answer).