If you're looking to create a form layout, one approach is to use a structured format like the following example:
<div>
<!-- container for one row, ie the 'First Name' label and its text input box -->
<div class="row">
<!-- separating the label and input into different divs allows for proper alignment -->
<div class="left-side"><p>First Name:</p></div>
<div class="right-side"><p><input type="text" class="textbox"/></p></div>
</div>
<div class="row">
<div class="left-side"><p>Last Name:<p></div>
<div class="right-side"><p><input type="email" class="textbox"/></p></div>
</div>
<div class="row">
<div class="left-side"><p>Student ID:<p></div>
<div class="right-side"><p><input type="text" class="textbox"/></p></div>
</div>
</div>
Repeat this structure for other form fields.
In your CSS, style the left-side
class with width and right-aligned text:
.left-side {
width: 100px;
text-align: right;
}
For the right-side
class, set width and left align:
.right-side {
width: 200px;
text-align: left;
}
To add a red * after each textbox, include the following code after the input:
<span class="redStar">*</span>
And define the .redStar
CSS class:
.redStar {
color: red;
}