-
-
Notifications
You must be signed in to change notification settings - Fork 492
Birmingham|26-ITP-May|Yonas Gebre|Sprint 1|Form Control #1264
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
778e937
304b08c
c70d30f
2f0ee3b
f409355
55ffbef
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,78 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <link rel="stylesheet" href="style.css" > | ||
| <meta charset="utf-8" /> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
| <title>My form exercise</title> | ||
| <meta name="description" content="" /> | ||
| <meta name="description" content="The page Contains Form to submit customer information about T-shirts" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <style> | ||
| input:valid{ | ||
| border:2px solid yellow; | ||
| } | ||
| input:invalid:not(:placeholder-shown){ | ||
| border:2px solid red; | ||
| } | ||
| </style> | ||
|
Comment on lines
+10
to
+17
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. Why is this code not in the CSS file as well? |
||
| </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--> | ||
| <!-- --> | ||
| <div> | ||
| <label for="customername">Customer name *: </label> | ||
| <input type="text" id="customername" name="customername" required | ||
|
Comment on lines
+26
to
+28
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. The formatting standard for HTML elements is to use indentation on children elements. This makes it easier to understand the structure. How can you ensure consistent formatting in your code automatically? |
||
| pattern="^[A-Za-z]{2,}$" | ||
| placeholder="Customer name"/> | ||
| </div> | ||
|
|
||
| <div> | ||
| <label for="customeremail">Customer email: </label> | ||
| <input type="email" id="customeremail" name="customeremail" required | ||
| pattern="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" | ||
|
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. This does not allow special charcaters like the German ä,ü,ö |
||
| placeholder="Customer email" /> | ||
| </div> | ||
|
|
||
| <div> | ||
| <label for="color">T-shirt color *:</label> | ||
| <div class="control"> | ||
| <label class="t-color"> | ||
| <input type="radio" name="color" value="Black" required/> | ||
| Black | ||
| </label> | ||
| <label class="t-color"> | ||
| <input type="radio" name="color" value="Red" required/> | ||
| Red | ||
| </label> | ||
| <label class="t-color" disabled> | ||
| <input type="radio" name="color" value="Blue" required/> | ||
| Blue | ||
| </label> | ||
| </div> | ||
| </div> | ||
| <div> | ||
| <label for="sizes">T-shirt size *:</label> | ||
| <select name="sizes" id="sizes" required> | ||
| <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 vallue="XXL">XXL</optio> | ||
|
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 4 errors in the w3 validator https://validator.w3.org/nu/#textarea |
||
| </select> | ||
| </div> | ||
| <div> | ||
| <button type="submit" id="submit">Submit</button> | ||
| </div> | ||
| </form> | ||
| </main> | ||
| </main> | ||
| <footer> | ||
| <!-- change to your name--> | ||
| <p>By HOMEWORK SOLUTION</p> | ||
| <p>By Yonas Gebre</p> | ||
| </footer> | ||
| </body> | ||
| </html> | ||
|
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. Good job that you separated the CSS into its own file—that’s an excellent best practice and will make your code much easier to read, debug, and maintain as it grows. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| /* body style */ | ||
| body { | ||
| background-color: lightwhite; | ||
| max-width: 800px; | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| padding: 25px; | ||
| } | ||
|
|
||
| header h1 { | ||
| color: #2c3e50; | ||
| margin-bottom: 15px; | ||
| } | ||
|
|
||
| form { | ||
| background: skyblue; | ||
| padding: 30px; | ||
| border-radius: 8px; | ||
| box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); | ||
| width: 100%; | ||
| max-width: 400px; | ||
| } | ||
| input:focus { | ||
| border-color: #3498db; | ||
| outline: none; | ||
| } | ||
| /* Labels and Inputs */ | ||
| label { | ||
| display: block; | ||
| margin-top: 15px; | ||
| margin-bottom: 5px; | ||
| font-weight: 600; | ||
| font-size: 0.9rem; | ||
| } | ||
|
|
||
| input[type="text"], | ||
| input[type="email"], | ||
| select,button { | ||
| align-items: right; | ||
| width: 100%; | ||
| padding: 10px; | ||
| border: 2px solid #ddd; | ||
| border-radius: 6px; | ||
| box-sizing: border-box; /* Ensures padding doesn't break width */ | ||
| transition: border-color 0.3s ease; | ||
| } | ||
|
|
||
| .radio { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: 5px; | ||
| font-weight: normal; | ||
| } | ||
| #submit { | ||
| background-color: #3498db; | ||
| margin-top: 15px; | ||
| border: none; | ||
| cursor: pointer; | ||
| font-size: 1rem; | ||
| } | ||
|
|
||
| /* Footer */ | ||
| footer { | ||
| margin-top: 20px; | ||
| font-size: 0.8rem; | ||
| color:black; | ||
| } |
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.
Why are there changes in this file? How is it related to the task?