Skip to content

London | May-2025 | Byron Medina | Form Controls #541

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
75 changes: 67 additions & 8 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,84 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>My form exercise</title>
<meta name="description" content="" />
<title>My form exercise - Sell a T-shirt</title>
<meta name="description" content="Order form for selling a t-shirt" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
/* Optional: Improve touch targets for radio buttons */
.radio-group label {
display: inline-block;
min-width: 48px;
padding: 8px 8px 8px 0;
margin-right: 12px;
cursor: pointer;
}
.radio-group input[type="radio"] {
margin-right: 6px;
}
</style>
</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-->
<!-- Requirements as comments -->
<!-- 1. Customer name (min 2 chars) -->
<!-- 2. Customer email -->
<!-- 3. 3 color options, only one allowed -->
<!-- 4. 6 size options -->
<section>
<h2>T-shirt Selection Form</h2>
<p>
Required fields are marked with <span style="color: red;" aria-label="required">*</span>
</p>
<fieldset>
<legend>Customer Information</legend>
<label for="name">
Name: <span style="color: red;" aria-label="required">*</span>
</label>
<input type="text" id="name" name="name" required minlength="2" autocomplete="name" />
<br><br>
<label for="email">
Email: <span style="color: red;" aria-label="required">*</span>
</label>
<input type="email" id="email" name="email" required autocomplete="email" />
</fieldset>
<br>
<fieldset>
<legend>Color Options <span style="color: red;" aria-label="required">*</span></legend>
<div class="radio-group">
<input type="radio" id="color_red" name="color" value="red" required>
<label for="color_red">Red</label>
<input type="radio" id="color_blue" name="color" value="blue">
<label for="color_blue">Blue</label>
<input type="radio" id="color_yellow" name="color" value="yellow">
<label for="color_yellow">Yellow</label>
</div>
</fieldset>
<br>
<fieldset>
<legend>Size <span style="color: red;" aria-label="required">*</span></legend>
<label for="size">Select size:</label>
<select id="size" name="size" required>
<option value="">--Please choose an option--</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>
</fieldset>
<br>
<button type="submit">Submit Order</button>
</section>
</form>
</main>
<footer>
<!-- change to your name-->
<h2>By HOMEWORK SOLUTION</h2>
<p>By Byron Medina</p>
</footer>
</body>
</html>
51 changes: 31 additions & 20 deletions Wireframe/index.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Wireframe</title>
<link rel="stylesheet" href="style.css" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Learn the purpose of README files, wireframes, and Git branches.">
<title>Project Essentials: README, Wireframes, and Git Branches</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<h1>Wireframe</h1>
<p>
This is the default, provided code and no changes have been made yet.
</p>
<h1>Project Essentials</h1>
<p>Understand the importance of README files, wireframes, and Git branches in software development.</p>
</header>
<main>
<article>
<img src="placeholder.svg" alt="" />
<h2>Title</h2>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam,
voluptates. Quisquam, voluptates.
</p>
<a href="">Read more</a>
</article>
<section>
<article>
<h2>What is the purpose of a README file?</h2>
<p>
A README file provides documentation for your project, explaining its purpose, structure, and how to use it. It helps users and collaborators understand your project quickly.
</p>
<a href="https://www.makeareadme.com/" target="_blank" rel="noopener">Learn more about README files</a>
</article>
<article>
<h2>What is the purpose of a wireframe?</h2>
<p>
A wireframe is a visual guide that represents the skeletal framework of a website or application. It helps teams plan layout and user experience before starting the design or development process.
</p>
<a href="https://www.toptal.com/designers/ui/wireframing" target="_blank" rel="noopener">Learn more about wireframes</a>
</article>
<article>
<h2>What is a branch in Git?</h2>
<p>
A branch in Git is a separate line of development that allows you to work on new features or fixes without affecting the main codebase. Branches make collaboration and parallel development easier.
</p>
<a href="https://www.atlassian.com/git/tutorials/using-branches" target="_blank" rel="noopener">Learn more about Git branches</a>
</article>
</section>
</main>
<footer>
<p>
This is the default, provided code and no changes have been made yet.
</p>
<p>&copy; 2025 Project Essentials</p>
</footer>
</body>
</html>
132 changes: 53 additions & 79 deletions Wireframe/style.css
Original file line number Diff line number Diff line change
@@ -1,89 +1,63 @@
/* 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 */
body {
margin: 0;
font-family: Arial, sans-serif;
min-height: 100vh;
display: flex;
flex-direction: column;
background: #fff;
color: #222;
}

/* ====== 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 ====== */
: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;
header {
background: #f4f4f4;
padding: 1.5em 1em 1em 1em;
text-align: center;
}
/* ====== Base Elements ======
General rules for basic HTML elements in any context */
body {
background: var(--paper);
color: var(--ink);
font: var(--font);

main {
flex: 1;
padding: 1em;
background: #fff;
}
a {
padding: var(--space);
border: var(--line);
max-width: fit-content;

section {
display: flex;
flex-direction: column;
gap: 2em;
max-width: 800px;
margin: 0 auto;
}
img,
svg {
width: 100%;
object-fit: cover;

article {
background: #e9ecef;
padding: 1em;
border-radius: 8px;
box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
/* ====== 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;

article h2 {
margin-top: 0;
}

article a {
color: #0056b3;
text-decoration: underline;
font-weight: bold;
}

article a:focus,
article a:hover {
outline: 2px solid #0056b3;
background: #dbeafe;
}

footer {
background: #222;
color: #fff;
text-align: center;
padding: 1em 0;
position: fixed;
width: 100%;
bottom: 0;
text-align: center;
}
/* ====== 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;
}
}
/* ====== 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;
}
left: 0;
}