Having the inputs inside the labels is making it difficult to align properly. I would have the label first, then the corresponding input.
You have absolutely no CSS targeting the text-area. So, why would it span the whole div? Add some CSS controlling the width of the #comments text-area.
Lastly, you can just use the * selector for that “START CSS RESET” you have.
Hi Sky, thanks for the tip. I was able to target the comment text-area.
However, having the label first followed by the corresponding input does not align the label and the input on the same line. The two are still on different lines.
To supplement @Sky020, I have noticed so many issues with your code. You have to clean it:
Codepen doesn’t require you to include <head> </head> , <html> </html> or <body> </body> tags in your html. They are included behind the scenes for you Check Their Documentation Here
You are enclosing label and its corresponding inputs in separate divs. divs are block elements. I suggest enclose an input element in its corresponding label element and remove the divs enclosing them in the form.
You are applying display: block on an element and width: 100% at the same time. A block element will always take up the width of the entire container.
When doing a reset of padding and margin it is not necessary to type names of all tag elements in the document to do it. simply select everything using an asterisk (*) and apply the reset.
*{ } //Selects everything
Finally i suggest after enclosing an input element in its corresponding label like this
<label id="name-label" for="name"> Name
<input type="text" class="input-field" id="name" placeholder="Enter your name" required >
</label>
apply display flex on the label and make the width of the input 100% like
Apply display flex on the label and input field containers. Eg Below is one of the form elements. I applied an additional class name-container to the container div