Hey! I am really new to coding (three weeks in) and trying to submit the projects to get the basic HTML certification. I was wondering if anyone had any critiques on my survey form. I thought it would be cool to have the survey show up just in the background’s movie screen, but I can’t figure that out!
I thought it would be cool to have the survey show up just in the background’s movie screen, but I can’t figure that out!
As for a critique, you have done awesome for only being 3 weeks in! Basic things like good contrast, good use of html attributes. The only thing I would recommend is keeping your CSS a bit more DRY(Don’t Repeat Yourself). Instead of using
I meant that I was trying to figure out how to make the code only appear in the background image’s movie screen. Kinda like the form would look like credits? Not sure if I just got a bug in my bonnet about something silly.
Welcome to the forums @victoriakee95. Your form looks good. Some things to revisit;
On using codepen. codepen only expects the code you’d put within the <body> </body> tags in HTML. (No need to include the body tags). For anything you want to add to <head> click on the ‘Settings’ button, then HTML and add it into the ‘Stuff for <head>’ box.
Run your HTML code through the W3C validator. Just copy your HTML and paste it into the ‘Validate by Direct Input’ tab.
There are a few errors and warnings you should clean up.
Users should be able to click on the labels to select, not just the radio buttons/checkboxes
Don’t use <br> to force spacing. Use margin and/or padding in CSS
There are ways to group radio buttons and checkboxes, Google ‘fieldset’
Change the cursor to a pointer when hovering over the submit button
Make your form responsive.
Your title and description fall out on smaller screens.
For practice, in the CSS section, click on the down arrow and then click on the ‘Format CSS’ link to see how your CSS file should be formatted for readability.
As an aside, Arial does not need to be in quotes as it’s a single name and the correct name for the fallback font is sans-serif
Thank you so much! The W3C validator is a lifesaver. I honestly forgot about fieldsets until you said that, much appreciated. What do you mean by “users should be able to click on labels to select”? I don’t know if I’ve run across that yet or know why it would be important.
@victoriakee95, all you need to do is nest the buttons within their own label element. By wrapping an input element inside of a label element it will automatically associate the radio button input with the label element surrounding it. (Directly quoting the lesson and the same thing goes for checkboxes)
So something like; <label for="romcom"><input id="romcom" type="radio" name="movie-genres" value="romcom">Romantic Comedy</label>
will make it so users can click either the radio button, or the label ‘Romantic Comedy’ to select it.