label for input left aligned code example
Example: label for input left aligned
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
div {
margin-bottom: 10px;
}
label {
display: inline-block;
width: 150px;
text-align: right;
}
</style>
</head>
<body>
<form action="/form/submit" method="post">
<div>
<label>Short</label>
<input type="text" />
</div>
<div>
<label>Simple label</label>
<input type="text" />
</div>
<div>
<label>Label having more text</label>
<input type="text" />
</div>
</form>
</body>
</html>