The right way to create forms

I am currently creating a registration form and I am resorting to tables to properly align them. the equivalent of MySpace , where I would use colspan to achieve an even spacing between three text boxes and other text inputs. Is this against conventions and should I look for more advanced CSS?

+6
source share
3 answers

I think you should put it all together and use more CSS. You can look at this: http://www.webcredible.co.uk/user-friendly-resources/css/css-forms.shtml

+5
source

I prefer using Divs, float and fields rather than tables

+1
source

In general, this is contrary to agreements. You must use CSS to place your elements here. However, CSS does not need to be promoted. For instance.

<div class="field-name"><label for="birthday">Birthday</label></div> <div class="field"><input class="text-field" name="birthday" type="text" /></div> 

CSS can be added to these elements.

 .field-name{ float:left; width:100px; } .field{float:left; width:150px;} 

Then you should place your fields next to each other. I'm not sure about your layout, but this is a simple example. You can also remove the div, if necessary, and change the CSS accordingly. Hope this helps.

+1
source

Source: https://habr.com/ru/post/892477/


All Articles