I've got the following code:
HTML:
<div class="label">Middle</div>
<div id='sliderdiv'>
<input type="range" value="50" min="0" max="100" />
</div>
CSS:
.label {
position: absolute;
margin-top: 13px;
margin-left: auto;
margin-right: auto;
z-index: 3;
}
input.ui-slider-input {
display: none !important;
}
#sliderdiv .ui-slider-track {
margin-left: 15px;
}
But I can't center my text div, is there a solution for this problem or is it not possible with css?
I could calculate it dynamically with javascript for sure, but I'd like to avoid that.
Here is the live code for you: http://jsfiddle.net/VmwQM/
Edit:
This is not what I want:
.label {
position: absolute;
margin-top: 13px;
margin-left: 50%;
z-index: 3;
}
Because I want my text middle at 50% and not my text to start at 50%.