.col-sm-12#customer
%h2 Customer Information
%dl.dl-horizontal
%dt Phone Number
%dd
%div(style="padding:0px;"class="col-sm-4")
.input-group
= text_field_tag 'customer [phone1]', '', class: "form-control"
%span.input-group-addon-
= text_field_tag 'customer [phone2]', '', class: "form-control"
%span.input-group-addon-
= text_field_tag 'customer [phone3]', '', class: "form-control"
%div(style="padding:0px;"class="col-sm-12")
Enter <b>03-9999-9999</b> in .supplementation half-width.
Instead of thinking too hard, I thought it would be better to add a class to each item and specify the width on the style sheet.
.col-sm-12#customer
%h2 Customer Information
%dl.dl-horizontal
%dt Phone Number
%dd
%div(style="padding:0px;"class="col-sm-4")
.input-group
= text_field_tag 'customer [phone1]', '', class: "form-control area-code"
%span.input-group-addon-
= text_field_tag 'customer [phone2]', '', class: "form-control city-code"
%span.input-group-addon-
= text_field_tag 'customer [phone3]', '', class: "form-control subscriber-number"
%div(style="padding:0px;"class="col-sm-12")
Enter <b>03-9999-9999</b> in .supplementation half-width.
custom.sass
.area-code
width —30px
.city-code, .subscriber-number
width —50px
If there are any restrictions that cannot be adopted, please add them to the question.
.form-group
%label.col-xs-2.control-label Phone Number
.col-xs-10
%div(style="padding:0px;"class="col-xs-5")
.input-group
= text_field_tag 'customer[phone1]', '', class: "form-control", style: "width:60px;"
%span.input-group-addon-
= text_field_tag 'customer [phone2]', '', class: "form-control", style: "width:120px;"
%span.input-group-addon-
= text_field_tag 'customer [phone3]', '', class: "form-control", style: "width:120px;"
.col-xs-offset-2.col-xs-10
In %p.help-block half-width, type <b>03-9999-9999</b>
I don't know the cause, but I set the width in the style and it worked.
Thank you.
© 2024 OneMinuteCode. All rights reserved.