Is there a way to have inputs that have append and/or prepend to all have matching widths?
Here's an example, but you can see that given multiple inputs with appends/prepends of various lengths, the will all end up being different widths, and it won't look very good.
http://jsfiddle.net/PLkfq/1/
If you want to be pixel precise, forget classes and apply style to ids
add an id to the minutes span
<span id="minutes" class="add-on">minutes</span>
and use this bit of css
#service_name{width:200px;}
#service_duration{width:130px;}
#minutes{width:70px;}
http://jsfiddle.net/baptme/PLkfq/4/
you can use jQuery:
$(document).ready(function(){
var normal_width = $("#service_name").width();
var add_on = $(".add-on").width();
var after_width = normal_width-add_on+3;
$("#service_duration").width(after_width);
});
by this method you can set any size for your inputs
http://jsfiddle.net/PLkfq/25/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With