-
-
Notifications
You must be signed in to change notification settings - Fork 501
Manchester |26-ITP-May| SamreenAmjad |Sprint 1 | Form-Controls #1393
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
6709ec3
8f01d67
d560024
d261537
c2fc5e4
82e9a1d
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,72 @@ | ||
| <!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" /> | ||
| </head> | ||
| <body> | ||
| <header> | ||
| <h1>Product Pick</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> | ||
| </main> | ||
| <footer> | ||
| <!-- change to your name--> | ||
| <p>By HOMEWORK SOLUTION</p> | ||
| </footer> | ||
| </body> | ||
| </html> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
|
||
| <title>T-Shirt Order Form</title> | ||
|
|
||
| <meta name="description" content="Order a T-shirt by entering your details and selecting a colour and size."> | ||
| <meta name="robots" content="index, follow"> | ||
|
|
||
| <link rel="stylesheet" href="style.css"> | ||
| </head> | ||
|
|
||
| <body> | ||
|
|
||
| <main> | ||
| <form> | ||
| <h1>T-Shirt Order Form</h1> | ||
|
|
||
| <div class="form-group"> | ||
| <label for="name">Full Name</label> | ||
| <input | ||
| type="text" | ||
| id="name" | ||
| name="name" | ||
| required | ||
| minlength="2" | ||
| pattern=".*\S.*" | ||
| > | ||
| </div> | ||
|
|
||
| <div class="form-group"> | ||
| <label for="email">Email Address</label> | ||
| <input | ||
| type="email" | ||
| id="email" | ||
| name="email" | ||
| required | ||
| > | ||
| </div> | ||
|
|
||
| <div class="form-group"> | ||
| <label for="colour">Choose a Colour</label> | ||
| <select id="colour" name="colour" required> | ||
| <option value="">Select a colour</option> | ||
| <option value="black">Black</option> | ||
| <option value="white">White</option> | ||
| <option value="blue">Blue</option> | ||
| </select> | ||
| </div> | ||
|
|
||
| <div class="form-group"> | ||
| <label for="size">Choose a Size</label> | ||
| <select id="size" name="size" required> | ||
| <option value="">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> | ||
|
|
||
| <button type="submit">Submit Order</button> | ||
|
|
||
| </form> | ||
| </main> | ||
|
|
||
| </body> | ||
| </html> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| * { | ||
| box-sizing: border-box; | ||
| margin: 0; | ||
| padding: 0; | ||
| } | ||
|
|
||
| body { | ||
| font-family: Arial, sans-serif; | ||
| background-color: #f4f4f4; | ||
| min-height: 100vh; | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| } | ||
|
|
||
| form { | ||
| background-color: white; | ||
| padding: 30px; | ||
| border-radius: 10px; | ||
| width: 350px; | ||
| } | ||
|
|
||
| h1 { | ||
| text-align: center; | ||
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| .form-group { | ||
| margin-bottom: 15px; | ||
| } | ||
|
|
||
| label { | ||
| display: block; | ||
| margin-bottom: 5px; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| input, | ||
| select { | ||
| width: 100%; | ||
| padding: 10px; | ||
| } | ||
|
|
||
| button { | ||
| width: 100%; | ||
| padding: 10px; | ||
| border: none; | ||
| background-color: black; | ||
| color: white; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| button:hover { | ||
| background-color: #333; | ||
| } | ||
|
Comment on lines
+16
to
+55
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. @serveyano, your styling is visually strong. However, at the moment, many styles are applied directly to HTML tags. How might this affect other elements elsewhere on the page that use the same tags? What approach could give you more control over which specific elements receive these styles? |
||
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.
@serveyano, your email validation at the moment accepts invalid email addresses. For example,
.@gmail.com,hi@example.com, and lots more can pass. How could you prevent this vulnerability?