Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 41 additions & 27 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
<!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>
<form method="post">
<!-- Customer Name -->
<label for="customer-name">Customer Name</label>
<input
type="text"
id="customer-name"
name="customer_name"
required
pattern="[A-Za-zÀ-ÖØ-öø-ÿ' -]{2,}"
title="Please enter a valid name using letters, spaces, hyphens, or apostrophes."
/>
<!-- Customer Email -->
<label for="customer-email">Email Address</label>
<input
type="email"
id="customer-email"
name="customer_email"
required
/>
<!-- T‑Shirt Colour -->
<label for="tshirt-colour">T‑Shirt Colour</label>
<select id="tshirt-colour" name="tshirt_colour" required>
<option value="">Select a colour</option>
<option value="black">Black</option>
<option value="white">White</option>
<option value="blue">Blue</option>
</select>
<!-- T‑Shirt Size -->
<label for="tshirt-size">T‑Shirt Size</label>
<select id="tshirt-size" name="tshirt_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>
<button type="submit">Submit</button>
</form>

41 changes: 41 additions & 0 deletions Form-Controls/index.html.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<form method="post">
<!-- Customer Name -->
<label for="customer-name">Customer Name</label>
<input
type="text"
id="customer-name"
name="customer_name"
required
pattern="[A-Za-zÀ-ÖØ-öø-ÿ' -]{2,}"
title="Please enter a valid name using letters, spaces, hyphens, or apostrophes."
/>
<!-- Customer Email -->
<label for="customer-email">Email Address</label>
<input
type="email"
id="customer-email"
name="customer_email"
required
/>
<!-- T‑Shirt Colour -->
<label for="tshirt-colour">T‑Shirt Colour</label>
<select id="tshirt-colour" name="tshirt_colour" required>
<option value="">Select a colour</option>
<option value="black">Black</option>
<option value="white">White</option>
<option value="blue">Blue</option>
</select>
<!-- T‑Shirt Size -->
<label for="tshirt-size">T‑Shirt Size</label>
<select id="tshirt-size" name="tshirt_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>
<button type="submit">Submit</button>
</form>

174 changes: 95 additions & 79 deletions Wireframe/style.css
Original file line number Diff line number Diff line change
@@ -1,89 +1,105 @@
/* Here are some starter styles
You can edit these or replace them entirely
It's showing you a common way to organise CSS
And includes solutions to common problems
As well as useful links to learn more */

/* ====== Design Palette ======
This is our "design palette".
It sets out the colours, fonts, styles etc to be used in this design
At work, a designer will give these to you based on the corporate brand, but while you are learning
You can design it yourself if you like
Inspect the starter design with Devtools
Click on the colour swatches to see what is happening
I've put some useful CSS you won't have learned yet
For you to explore and play with if you are interested
https://web.dev/articles/min-max-clamp
https://scrimba.com/learn-css-variables-c026
====== Design Palette ====== */
/* ====== Design Palette ====== */
: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 */
--paper: oklch(7 0 0);
--color: oklch(70% 0.15 250);
--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 ====== */
*,
*::before,
*::after { box-sizing: border-box;
}
body {
background: var(--paper);
color: var(--ink);
font: var(--font);
margin: 0;
background: var(--paper);
color: var(--ink);
font: var(--font);
}
a {
display: inline-block;
padding: var(--space);
border: var(--line);
max-width: fit-content;
text-decoration: none;
color: inherit;
}
a {
padding: var(--space);
border: var(--line);
max-width: fit-content;
a:hover,
a:focus-visible {
background: var(--color);
color: black;
}
img,
svg {
width: 100%;
object-fit: cover;
svg {
width: 100%;
height: auto;
object-fit: cover;
}
/* ====== Site Layout ====== */
header {
max-width: var(--container);
margin: 0 auto;
padding: calc(var(--space) * 2) var(--space);
text-align: left;
}
/* ====== Site Layout ======
Setting the overall rules for page regions
https://www.w3.org/WAI/tutorials/page-structure/regions/
*/
main {
max-width: var(--container);
margin: 0 auto calc(var(--space) * 4) auto;
header h1 {
margin: 0 0 var(--space) 0;
}
header p {
margin: 0;
}
footer {
position: fixed;
bottom: 0;
text-align: center;
main {
max-width: var(--container);
margin: 0 auto calc(var(--space) * 4) auto;
padding: 0 var(--space) calc(var(--space) * 6);
}
/* ====== Articles Grid Layout ====
Setting the rules for how articles are placed in the main element.
Inspect this in Devtools and click the "grid" button in the Elements view
Play with the options that come up.
https://developer.chrome.com/docs/devtools/css/grid
https://gridbyexample.com/learn/
*/
main {
display: grid;
grid-template-columns: 1fr 1fr;
gap: var(--space);
> *:first-child {
grid-column: span 2;
}
/* Footer fixed to bottom */
footer {
position: fixed;
bottom: 0; left: 0;
right: 0;
text-align: center;
padding: var(--space);
background: var(--paper);
border-top: var(--line);
}
/* ====== Articles Grid Layout ====== */
main {
display: grid;
grid-template-columns:1fr 1fr;
gap: var(--space);
}
main > *:first-child {
grid-column: span 2;
}
/* ====== Article Layout ======
Setting the rules for how elements are placed in the article.
Now laying out just the INSIDE of the repeated card/article design.
Keeping things orderly and separate is the key to good, simple CSS.
*/
article {
border: var(--line);
padding-bottom: var(--space);
text-align: left;
display: grid;
grid-template-columns: var(--space) 1fr var(--space);
> * {
grid-column: 2/3;
}
> img {
grid-column: span 3;
}
/* ====== Article Layout ====== */
article {
border: var(--line);
padding-bottom: var(--space);
text-align: left;
display: grid;
grid-template-columns: var(--space) 1fr var(--space);
}
article > * {
grid-column: 2 / 3;
margin-top: var(--space);
}
article > img {
grid-column: 1 / 4;
margin: 0 0 var(--space) 0;
}
article h2 {
margin: 0;
}
/* ====== Responsive tweak ====== */
@media (max-width: 700px) {
main { grid-template-columns: 1fr;
}
main > *:first-child {
grid-column: auto;
}
footer {
position: static;
}
}
Loading
Loading