-
-
Notifications
You must be signed in to change notification settings - Fork 491
London | 26-ITP-May | Russom Gebremeskel | Sprint 1 | Form Controls #1292
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -6,22 +6,101 @@ | |
| <title>My form exercise</title> | ||
| <meta name="description" content="" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <style> | ||
| body { | ||
| font-family: Arial, sans-serif; | ||
| margin: 0; | ||
| padding: 0; | ||
| } | ||
| header { | ||
| color: black; | ||
| padding: 1rem; | ||
| text-align: center; | ||
| margin-bottom: 20px; | ||
| } | ||
| main { | ||
| padding: 1rem; | ||
| } | ||
| form { | ||
| max-width: 400px; | ||
| margin: 0 auto; | ||
| } | ||
| div { | ||
| margin-bottom: 1rem; | ||
| } | ||
| label { | ||
| display: block; | ||
| margin-bottom: 0.5rem; | ||
| } | ||
| input, | ||
| select { | ||
| width: 100%; | ||
| padding: 0.5rem; | ||
| box-sizing: border-box; | ||
| } | ||
| button { | ||
| padding: 0.5rem 1rem; | ||
| background-color: #333; | ||
| color: white; | ||
| border: none; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| </style> | ||
| </head> | ||
| <body> | ||
| <header> | ||
| <h1>Product Pick</h1> | ||
| </header> | ||
| <main> | ||
| <form> | ||
| <!-- write your html here--> | ||
| <!-- | ||
| try writing out the requirements first as comments | ||
|
|
||
| <div> | ||
|
|
||
| <label for="name"> Name:</label> | ||
| <input type="text" id="name" name="name" required pattern="\S{2,}" title="Please enter at least two non-space characters."> | ||
|
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. Well done on ensuring the required pattern is used for the name |
||
| </div> | ||
|
|
||
|
Comment on lines
+59
to
+63
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 see some new lines that are not needed. How can you ensure consistent formatting in your code automatically? |
||
| <div> | ||
| <label for="email"> Email:</label> | ||
| <input type="email" id="email" name="email" required> | ||
| </div> | ||
| <div> | ||
| <label for="color"> Colour:</label> | ||
| <select id="color" name="color" required> | ||
| <option value="">Please select a colour</option> | ||
| <option value="red">Red</option> | ||
| <option value="blue">Blue</option> | ||
| <option value="green">Green</option> | ||
| </select> | ||
| </div> | ||
| <div> | ||
| <label for="size"> Size:</label> | ||
| <select id="size" name="size" required> | ||
| <option value="">Please select 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> | ||
| </div> | ||
| <div> | ||
| <button type="submit">Submit</button> | ||
| </div> | ||
| <!-- | ||
| this will also help you fill in your PR message later--> | ||
| <!-- | ||
| What is the customer's name? I must collect this data and ensure it contains at least two non-space characters. | ||
| What is the customer's email? I must make sure the email is valid. Email addresses follow a consistent pattern. | ||
| What colour should this T-shirt be? I must provide 3 options. How will I ensure they do not choose other colours? | ||
| What size does the customer want? I must provide the following 6 options: XS, S, M, L, XL, XXL --> | ||
| </form> | ||
| </main> | ||
| <footer> | ||
| <!-- change to your name--> | ||
| <p>By HOMEWORK SOLUTION</p> | ||
| <p>By Russom G</p> | ||
| </footer> | ||
| </body> | ||
| </html> | ||
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.
How can you separate the styling from the html code to reduce the file size?