-
-
Notifications
You must be signed in to change notification settings - Fork 500
West Midlands| May 2026 | Muhammad-Burhan Mustafa | Sprint 1 | Form Controls #1282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
9a54070
893270c
d1fb3c6
9ace722
27c1bd3
ed06461
ab8d1e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,73 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
|
|
||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
| <title>My form exercise</title> | ||
| <meta name="description" content="" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <link rel = "stylesheet" href = "style.css"> | ||
| </head> | ||
|
|
||
| <body> | ||
|
|
||
| <header> | ||
| <h1>Product Pick</h1> | ||
| </header> | ||
| <main> | ||
| <form> | ||
|
|
||
| <form method = "get" class = "form-container"> | ||
| <!-- write your html here--> | ||
| <!-- | ||
| try writing out the requirements first as comments | ||
| this will also help you fill in your PR message later--> | ||
|
|
||
| <!-- All inputs are required and are labelled for accessibility and have corresponding name, for, and id attributes --> | ||
| <!-- Asks for their forename name --> | ||
| <label for = "forename"> Forename:</label> | ||
| <input type = "text" name = "forename" id="forename" minlength="2" required> | ||
| <br> | ||
|
|
||
| <!-- Asks for their surname --> | ||
| <label for = "surname"> Surname: </label> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Be careful about requiring both a forename and a surname. Not all people have 2 names, and some have many more. If you check the Readme it only asks for a "name" - how could you change the form to match this?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could ask for a full name instead of a forename and surname |
||
| <input type = "text" name = "surname" id="surname" minlength="2" required> | ||
| <br> | ||
|
|
||
| <!-- Asks for their email --> | ||
| <label for = "email"> Email: </label> | ||
| <input type = "email" name = "email" id="email" required> | ||
| <br> | ||
|
|
||
| <!-- Gives them the options to choose between 3 colours --> | ||
| <label for ="colour"> T-shirt Colour: </label> | ||
| <select name = "colour" id = "colour" required> | ||
| <option value = "" selected disabled>Choose a colour</option> | ||
| <option value = "white">White</option> | ||
| <option value = "black">Black</option> | ||
| <option value = "grey">Grey</option> | ||
| </select> | ||
| <br> | ||
|
|
||
| <!-- Gives them the option to choose between 6 sizes--> | ||
| <label for="size"> T-shirt Size:</label> | ||
| <select name = "size" id = "size" required> | ||
| <option value = "" selected disabled>Choose a size</option> | ||
| <option value = "xs">XS</option> | ||
| <option value = "s">S</option> | ||
| <option value = "m">M</option> | ||
| <option value = "l">L</option> | ||
| <option value = "xl">XL</option> | ||
| <option value = "xxl">XXL</option> | ||
| </select> | ||
| <br> | ||
|
|
||
| <!-- Submit button --> | ||
| <button type ="submit">Submit</button> | ||
|
|
||
| </form> | ||
| </main> | ||
|
|
||
| <footer> | ||
| <!-- change to your name--> | ||
| <p>By HOMEWORK SOLUTION</p> | ||
| <p>By Muhammad-Burhan Mustafa</p> | ||
| </footer> | ||
|
|
||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* Creates a container for the form that is also centered*/ | ||
|
|
||
| .form-container{ | ||
| display: flex; | ||
| flex-direction: column; | ||
| border-style:solid; | ||
| padding: 10px; | ||
| max-width:400px; | ||
| margin:auto; | ||
| font-size: 28px; | ||
| } | ||
|
|
||
| /* Ensures that inputs and options are standard size and centered*/ | ||
| .form-container input, | ||
| .form-container option{ | ||
| font-size: 24px; | ||
| width:100%; | ||
| max-width: 325px; | ||
| box-sizing: border-box; | ||
| margin-left:auto; | ||
| margin-right:auto; | ||
| } | ||
|
|
||
| /* Ensures that select and buttons are a standard size and centered*/ | ||
| .form-container select, | ||
| .form-container button{ | ||
| max-width:325px; | ||
| width: 100%; | ||
| box-sizing: border-box; | ||
| margin-left:auto; | ||
| margin-right:auto; | ||
| font-size: 24px; | ||
| } | ||
|
|
||
| h1{ | ||
| text-align: center; | ||
| } | ||
|
|
||
| footer{ | ||
| text-align: center; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you put spaces between the attribute and the value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no real reason aside from just muscle memory when I type.