-
-
Notifications
You must be signed in to change notification settings - Fork 500
Manchester | 26-ITP-May | John Robinson | Sprint 1 | Form Controls #1433
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 1 commit
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 |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| body { | ||
| font-family: Arial, sans-serif; | ||
| padding: 20px; | ||
| background-color: #408db7; | ||
| } | ||
|
|
||
| .header { | ||
| text-align: center; | ||
| margin-bottom: 20px; | ||
| background-color: #f0f8ff; | ||
| padding: 3px; | ||
| border-radius: 9px; | ||
| font-family: Arial; | ||
| font-style: bold; | ||
| font-size: medium; | ||
| } | ||
|
|
||
|
|
||
| .form-inputs { | ||
| width: 60%; | ||
| background:#f0f8ff; | ||
| text-align: left; | ||
| display: block; | ||
| margin: 0 auto; | ||
| padding: 10px; | ||
| border-radius: 8px; | ||
| box-shadow: 0 4px 6px rgba(0,0,0,0.1); | ||
| } | ||
|
|
||
| .form-selections { | ||
| width: 60%; | ||
| background:#f0f8ff; | ||
| text-align: left; | ||
| display: block; | ||
| margin: 0 auto; | ||
| padding: 10px; | ||
| border-radius: 8px; | ||
| box-shadow: 0 4px 6px rgba(0,0,0,0.1); | ||
| } | ||
|
|
||
| label { | ||
| display: block; | ||
| margin-bottom: 10px; | ||
| font-weight: 600; | ||
| } | ||
|
|
||
| input[type="text"], | ||
| input[type="email"], | ||
| select { | ||
| width: 100%; | ||
| padding: 10px; | ||
| border: 1px solid #ccc; | ||
| border-radius: 10px; | ||
| box-sizing: border-box; /* Crucial for width alignment */ | ||
| } | ||
|
|
||
| .footer { | ||
| text-align: left; | ||
| margin-top: 20px; | ||
| background-color: #408db7; | ||
| padding: 20px; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <link href="index.css" rel="stylesheet"> | ||
| <meta charset="utf-8" /> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
| <title>My form exercise</title> | ||
|
|
@@ -9,19 +10,45 @@ | |
| </head> | ||
| <body> | ||
| <header> | ||
| <h1>Product Pick</h1> | ||
| <h1>T Shirt Order Form</h1> | ||
| </header> | ||
| <main> | ||
| <form> | ||
| <!-- write your html here--> | ||
| <!-- | ||
| try writing out the requirements first as comments | ||
| this will also help you fill in your PR message later--> | ||
| </form> | ||
| <form> | ||
| <!-- Name Field --> | ||
| <div class="form-inputs"> | ||
| <label for="name">Full Name</label> | ||
| <input type="text" id="name" name="name" required pattern =".*\S.*\S.*" placeholder="John Robinson"> | ||
|
|
||
| <label for="email">Email Address</label> | ||
| <input type="email" id="email" name="email" required pattern="^[^\s@]+@[^\s@]+\.[^\s@]+$" placeholder="john@example.com"> | ||
| </div> | ||
|
|
||
| <!-- Shirt Colour 3 colours only--> | ||
| <div class="form-selections"> | ||
| <label for="colour">T Shirt Colour</label> | ||
| <select id="colour" name="colour"> | ||
| <option value="Red">Red</option> | ||
| <option value="White">White</option> | ||
| <option value="Black">Black</option> | ||
| </select> | ||
|
|
||
|
|
||
| <!-- Shirt size xs - xxl --> | ||
|
|
||
| <label for="size">T Shirt Size</label> | ||
| <select id="size" name="Size"> | ||
| <option value="XS">XSmall</option> | ||
| <option value="S">Small</option> | ||
| <option value="M">Medium</option> | ||
| <option value="L">Large</option> | ||
| <option value="XL">XLarge</option> | ||
| <option value="XXL">XXLarge</option> | ||
| </select> | ||
| </div> | ||
| </form> | ||
| </main> | ||
|
Contributor
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. Indentation is slightly off. Consider enabling VS Code's "Format on Save" option or to use its "Format Document" command to keep your code consistently formatted.
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 have indented the HTML code, Thanks |
||
| <footer> | ||
| <!-- change to your name--> | ||
| <p>By HOMEWORK SOLUTION</p> | ||
| <p>By John Robinson</p> | ||
| </footer> | ||
| </body> | ||
| </html> | ||
| </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.
There is a way to configure a
<select>element so that no option is selected by default, allowing the user to make an explicit choice.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.
Thank you, thats great & have added that