Skip to content
Open
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
87 changes: 83 additions & 4 deletions Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,101 @@
<title>My form exercise</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
header {
color: black;
padding: 1rem;
text-align: center;
margin-bottom: 20px;
}
main {
padding: 1rem;
}
form {
max-width: 400px;
margin: 0 auto;
}
div {
margin-bottom: 1rem;
}
label {
display: block;
margin-bottom: 0.5rem;
}
input,
select {
width: 100%;
padding: 0.5rem;
box-sizing: border-box;
}
button {
padding: 0.5rem 1rem;
background-color: #333;
color: white;
border: none;
cursor: pointer;
}

</style>
Comment on lines +9 to +49
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can you separate the styling from the html code to reduce the file size?

</head>
<body>
<header>
<h1>Product Pick</h1>
</header>
<main>
<form>
<!-- write your html here-->
<!--
try writing out the requirements first as comments

<div>

<label for="name"> Name:</label>
<input type="text" id="name" name="name" required pattern="\S{2,}" title="Please enter at least two non-space characters.">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done on ensuring the required pattern is used for the name

</div>

Comment on lines +59 to +63
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see some new lines that are not needed. How can you ensure consistent formatting in your code automatically?

<div>
<label for="email"> Email:</label>
<input type="email" id="email" name="email" required>
</div>
<div>
<label for="color"> Colour:</label>
<select id="color" name="color" required>
<option value="">Please select a colour</option>
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>
</div>
<div>
<label for="size"> Size:</label>
<select id="size" name="size" required>
<option value="">Please 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>
<div>
<button type="submit">Submit</button>
</div>
<!--
this will also help you fill in your PR message later-->
<!--
What is the customer's name? I must collect this data and ensure it contains at least two non-space characters.
What is the customer's email? I must make sure the email is valid. Email addresses follow a consistent pattern.
What colour should this T-shirt be? I must provide 3 options. How will I ensure they do not choose other colours?
What size does the customer want? I must provide the following 6 options: XS, S, M, L, XL, XXL -->
</form>
</main>
<footer>
<!-- change to your name-->
<p>By HOMEWORK SOLUTION</p>
<p>By Russom G</p>
</footer>
</body>
</html>
Loading