Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

London-10-Ahmed -Adam | HTML-CSS-Challenges #240

Open
wants to merge 1 commit 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
33 changes: 32 additions & 1 deletion Form-Controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,43 @@ <h1>Product Pick</h1>
<form>
<!-- write your html here-->
<!-- try writing out the requirements first-->
<label for="name">Name:</label>
<input type="text" id="name" name="name" required minlength="2">

<label for="email">Email:</label>
<input type="email" id="email" name="email" required>

<label for="color">Color:</label>
<select id="color" name="color" required>
<option value="">Please select a color</option>
<option value="red">Red</option>
<option value="blue">Blue</option>
<option value="green">Green</option>
</select>

<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>

<label for="delivery-date">Delivery Date:</label>
<input type="date" id="delivery-date" name="delivery-date" required min="<?= date('Y-m-d') ?>"
max="<?= date('Y-m-d', strtotime('+4 weeks')) ?>">

<button type="submit">Submit</button>

</form>

</main>
<footer>
<!-- change to your name-->
<h2>By HOMEWORK SOLUTION</h2>
<h2>By Ahmed Adam </h2>
</footer>
</body>

Expand Down
66 changes: 66 additions & 0 deletions Form-Controls/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/* Style the form label */
label {
display: block;
margin-bottom: 0.5rem;
font-weight: bold;

}

/* Style the form input and select elements */
input,
select {
padding: 0.5rem;
font-size: 1rem;
border-radius: 0.25rem;
border: 1px solid #ccc;
width: 100%;
}

/* Style the submit button */
button[type="submit"] {
background-color: #007bff;
color: #fff;
border: none;
border-radius: 0.25rem;
padding: 0.5rem 1rem;
font-size: 1rem;
cursor: pointer;
}

button[type="submit"]:hover {
background-color: #0069d9;
}

/* Style the form elements when they are in focus */
input:focus,
select:focus {
border-color: #007bff;
outline: none;
}

/* Style the error message */
input:invalid,
select:invalid {
border-color: #070707;
}

input:invalid:focus,
select:invalid:focus {
border-color: #201e1e;
outline: none;
}

/* Style the error message text */
input:invalid+span,
select:invalid+span {
color: #1c1a1a;
font-size: 0.8rem;
display: block;
margin-top: 0.25rem;
}

/* Hide the error message by default */
input+span,
select+span {
display: none;
}