Why the input text and password fields are not line up?
Username and Password are different length words
How can I fix that problem ?
- Use a monospace font
- Wrap the words in an element that you set to
display: inline-block; width: ???
where ??? is a fixed value.
That element could be the labels.
<label for="username"> Username:</label> <input type="text" name="username" id="username" /></label><br />
<label for="password"> Password:</label> <input type="password" name="password" id="password" /></label>
label {
display: inline-block;
width: 7em; /* adjust to taste */
}
Keep in mind that you will get different fonts on different systems, so give yourself some leeway with the width of the elements if you take the second approach.