First of all, I really appreciate how active this forum is! I got great feedback and help with my first project, and I felt a bit more confident going into my second.
For my Survey Form project, I decided on a fun throwback theme to the online quizzes of early Internet days. Feel free to take it, haha.
My main question re: the code at this point: Is there a way to adjust the background of my textarea label? You can see that the blue color doesn’t extend as far as the rest of the labels, even though it’s part of the same class. I’m guessing there’s something unique about textarea labels, and I made an additional ID to adjust it, but I haven’t figured out what property to use.
I welcome any and all feedback, particularly regarding the code. Is there anything I left out re: accessibility or responsiveness?
The reason the blue background doesn’t go all the way to the edge of the purple background is because you have side padding on <main>, which is keeping the <p>s from extending all the way to the edge of <main>. So you’ll either need to get rid of the side padding or you could use negative side margins on the labels to extend them all the way to the edge.
Concerning those labels, I would recommend you use a fieldset/legend with these checkbox and radio button groupings. It is much more semantically correct and much more accessible.
Thanks for your response! I appreciate the recommendation to use fieldset/legend groupings, and I’ve modified my code to include that.
Unfortunately, the padding issue does not seem to affect the way the textarea label extends. I had also tried negative side margins, to no effect. Right now, the fieldset/legend attributes have changed all the blue labels to be the same, so it’s fine stylistically, but I would still like to know how I could modify the code to extend all labels (textarea label included) to the edges if I wanted to.
You can use a class just fine on the legend element, just don’t use the same class as you are using for the labels.
You are using the .question class for the labels and you do not really want to apply the same styles to them. It might not be very noticeable but the styles needed for the legend aren’t needed for the labels so there is no reason to apply the styles to them.