Input box 100% width, with label to the left

Viewed 11714

I'm trying to have a fluid input box with 100% width, while having the label floated to the left. Here's what I currently have:

.left {
  float: left;
}

input {
  width: 100%;
}

<form>
    <label class="left">Name:</label>
    <input class="left" id="name" name="name"/>
    <div class="clear"></div>
</form>

This works, however it drops down below the label. If I use a parent div to assign the floats, then it doesn't span 100%. Any ideas?

Thank you!

2 Answers
Related