tags:

views:

43

answers:

3

Hi,

i have this page.

Press "Registrate".

Is there any way to align vertically each field with the error message without giving a left margin?

Regards

Javi

A: 

You will need to move your error message elements into their corresponding <li class="form_1"> elements. Then, assign float: left; to each error message element.

David Foster
shouldn't it be float: right, as the error message should be on the right side of the input box?
Scoregraphic
the error should be below the field.
@Scoregraphic: `float: left;` and `float: right;` will both do the trick. I prefer floating left though as it will position the error just to the right of the relevant field, whereas floating right will position it as far to the right as possible.
David Foster
A: 

Putting everything into list-items will be tricky. You could change this:

<li class="form_1_errores">
  <ul class="error_list">
    <li>Debes escribir tu e-mail</li>
  </ul>
</li>
<li class="form_1">
  <label for="register_password">Contrase&#241;a</label>
</li>
<li class="form_1">
  <input type="password" name="register[password]"
  id="register_password"></input>
</li>

To This:

<li class="form_1">
  <label for="register_password">Contrase&#241;a</label>
  <input type="password" name="register[password]"
  id="register_password"></input>
  <ul class="error_list">
    <li>Debes escribir tu e-mail</li>
  </ul>
</li>

.form_1 label, .form_1 input, .form_1 ul{
    float: left;
}
weesilmania
A: 

Instead of assign a margin-left to each individual item, give the margin to the containing block. #formulario_registro seems like the best candidate.

Also as I suggested in your other post: There is nothing wrong with layouting forms like this with a table.

RoToRa
Thanks RoToRa, but two questions: what are "the other kind forms" ?? what's your opinion about this http://www.chromaticsites.com/blog/13-reasons-why-css-is-superior-to-tables-in-website-design/ ?? There too many reasons..
@user248969, I think @RoToRa means that this is tabular data and so there is nothing wrong with using tables to display it. Which is a good and solid argument that doesn't go against what is said in that article.
ANeves