diff --git a/Form-Controls/README.md b/Form-Controls/README.md index f21386f42..c1ea4b5e4 100644 --- a/Form-Controls/README.md +++ b/Form-Controls/README.md @@ -14,19 +14,19 @@ We are selling t-shirts. Write a form to collect the following data: -Our customers already have accounts, so we know their addresses and charging details already. We don't need to collect that data. We want to confirm they are the right person, then get them to choose a colour and size. +Our customers already have accounts, so we know their addresses and charging details already. We don't need to collect that data. We want to confirm they are the right person, then get them to choose a color and size. Writing that out as a series of questions to ask yourself: 1. What is the customer's name? I must collect this data, and validate it. But what is a valid name? I must decide something. 2. What is the customer's email? I must make sure the email is valid. Email addresses have a consistent pattern. -3. What colour should this t-shirt be? I must give 3 options. How will I make sure they don't pick other colours? +3. What color should this t-shirt be? I must give 3 options. How will I make sure they don't pick other colors? 4. What size does the customer want? I must give the following 6 options: XS, S, M, L, XL, XXL All fields are required. Do not write a form action for this project. -## Developers must test their work. +## Developers must test their work Let's write out our testable criteria. Check each one off as you complete it. @@ -40,7 +40,7 @@ Let's write out our testable criteria. Check each one off as you complete it. - [ ] My Lighthouse Accessibility score is 100. - [ ] I require a valid name. I have defined a valid name as a text string of two characters or more. - [ ] I require a valid email. -- [ ] I require one colour from a defined set of 3 colours. +- [ ] I require one color from a defined set of 3 colors. - [ ] I require one size from a defined set of 6 sizes. ## Resources diff --git a/Form-Controls/index.html b/Form-Controls/index.html index 74b591ffc..7ce7f4129 100644 --- a/Form-Controls/index.html +++ b/Form-Controls/index.html @@ -6,6 +6,7 @@ My form exercise +
@@ -13,15 +14,52 @@

Product Pick

- +

please enter the required (*) information to order your T-shirt.

+
+ Customer Information + + +
+ + +
+ + customer name, with validation + customer's email + ---- The upper one customer information----- + // + ---- The lower one product information----- + color of T-shire (choose one from 3 option) + size of T-shirt (choose one from xs, s, m, l, xl,xxl)--> +
+ Product Information + + +
+ + +
+ +
diff --git a/Form-Controls/style.css b/Form-Controls/style.css new file mode 100644 index 000000000..42fbd8371 --- /dev/null +++ b/Form-Controls/style.css @@ -0,0 +1,42 @@ +:root { + --paper: oklch(7 0 0); + --ink: color-mix(in oklab, var(--color) 5%, black); + --font: 100%/1.5 system-ui; + --space: clamp(6px, 6px + 2vw, 15px); + --line: 1px solid; + --container: 1280px; +} +/* ====== Base Elements ====== + General rules for basic HTML elements in any context */ +body { + background: var(--paper); + color: var(--ink); + font: var(--font); +} +/* ====== Site Layout ====== +Setting the overall rules for page regions +https://www.w3.org/WAI/tutorials/page-structure/regions/ +*/ +body { + max-width: var(--container); + margin: 0 auto calc(var(--space) * 4) auto; +} +h1 { + + text-align: center; +} +fieldset{ + padding:var (--space); + max-width:100%; +} +input :invalid +{ + border-color:red; +} +footer{ + background-image: linear-gradient(to right, grey, lightgreen); + width:var(--container); + position: fixed; + bottom: 0; + text-align: center; +} \ No newline at end of file