I am creating a registration form for a website. I want each label and its corresponding input element to appear on the same line.
Here\'s my code:
Aside from using floats, as others have suggested, you can also rely on a framework such as Bootstrap where you can use the "horizontal-form" class to have the label and input on the same line.
If you're unfamiliar with Bootstrap, you would need to include:
It's very straight forward and you wouldn't have to mess with floats or a ton of CSS for formatting, as you listed above.