bootstrap: form-horizontal not styling as expected -


I am using Twitter Bootstrap and want a horizontal look as shown in a demo here: < P> However, I get a type of vertical form, which I think with the label in control, I do not know why vertical form styling is not working.

Here is the html code (generated from Symphony 2 framework:

  

Is something wrong?

You need to implement the .control-label class in your label For your form styling and .controls , separate your input to apply the container correctly. Try it instead:

  & lt; Form class = "form-horizontal" method = "POST" action = "/ yourownpoet / web / app_dev.php / register /" & gt; & Lt; Div class = "control-group" & gt; = "Fos_user_registration_form_email" placeholder = "email" & gt; Email: & lt; / Label & gt; For & lt; Label class = "control-label required" & lt; Div class = "control" & gt; & Lt; Input id = "fos_user_registration_form_email" class = "text-style" type = "email" placeholder = "email" required = "required" name = "fos_user_registration_form [email]" & gt; & Lt; Div placeholder = "password" id = "fos_user_registration_form_plainpashword" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "control-group" & gt; & Lt; Label class = "control-label required" = "fos_user_registration_form_plainPassword_Enter password:" & gt; Enter password: & lt; / Labels & gt; & Lt; Div class = "control" & gt; & Lt; Input type = "password" required = "required" name = "fos_user_registration_form [plainpassword] [enter password]" id = "fos_user_registration_form_plainPassword_Enter password:" class = "text-style" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "control-group" & gt; & Lt; Label class = "control-label required" = "fos_user_registration_form_plainPassword_ verify password:" & gt; Verify Password: & lt; / Labels & gt; & Lt; Div class = "control" & gt; & Lt; Input type = "password" required = "required" name = "fos_user_registration_form [plainpassword] [verify password:]" id = "fos_user_registration_form_plainPassword_ verify password:" class = "text-style" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Form & gt;    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -