Skip to content
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

Final Code Preview Different from Code Along Example #784 #785

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
57 changes: 25 additions & 32 deletions html/forms/your-first-HTML-form/first-form-styled.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,23 @@
<title>Your first HTML form, styled</title>
<style>
body{
/* Just to center the form on the page */
/* Center the form on the page */
text-align: center;
}
form {
display: inline-block;
/* To see the outline of the form */
/* Form outline */
padding: 1em;
border: 1px solid #ccc;
border-radius: 1em;
}

ul {
list-style: none;
padding: 0;
margin: 0;
}

form li + li {
p + p {
margin-top: 1em;
}

label {
/* To make sure that all labels have the same size and are properly aligned */
/* Uniform size & alignment */
display: inline-block;
min-width: 90px;

Expand All @@ -38,9 +32,10 @@
textarea {
/* To make sure that all text fields have the same font settings By default, textareas have a monospace font */
font: 1em sans-serif;
/* To give the same size to all text fields */
/* Uniform text field size */
width: 300px;
box-sizing: border-box; /* To harmonize the look & feel of text field border */
box-sizing: border-box;
/* Match form field borders */
border: 1px solid #999;
}

Expand All @@ -53,14 +48,14 @@
}

textarea {
/* To properly align multiline text fields with their labels */
/* Align multiline text fields with their labels */
vertical-align: top;
/* To give enough room to type some text */
/* Provide space to type some text */
height: 5em;
}

.button {
/* To position the buttons to the same position of the text fields */
/* Align buttons with the text fields */
padding-left: 90px;
/* same size as the label elements */
}
Expand All @@ -74,23 +69,21 @@

<body>
<form action="/my-handling-form-page" method="post">
<ul>
<li>
<label for="name">Name:</label>
<input type="text" id="name" name="user_name" />
</li>
<li>
<label for="mail">E-mail:</label>
<input type="email" id="mail" name="user_mail" />
</li>
<li>
<label for="msg">Message:</label>
<textarea id="msg" name="user_message"></textarea>
</li>
<li class="button">
<button type="submit">Send your message</button>
</li>
</ul>
<p>
<label for="name">Name:</label>
<input type="text" id="name" name="user_name" />
</p>
<p>
<label for="mail">E-mail:</label>
<input type="email" id="mail" name="user_mail" />
</p>
<p>
<label for="msg">Message:</label>
<textarea id="msg" name="user_message"></textarea>
</p>
<p class="button">
<button type="submit">Send your message</button>
</p>
</form>
</body>
</html>
32 changes: 15 additions & 17 deletions html/forms/your-first-HTML-form/first-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,21 @@

<body>
<form action="/my-handling-form-page" method="post">
<ul>
<li>
<label for="name">Name:</label>
<input type="text" id="name" name="user_name" />
</li>
<li>
<label for="mail">E-mail:</label>
<input type="email" id="mail" name="user_mail" />
</li>
<li>
<label for="msg">Message:</label>
<textarea id="msg" name="user_message"></textarea>
</li>
<li class="button">
<button type="submit">Send your message</button>
</li>
</ul>
<p>
<label for="name">Name:</label>
<input type="text" id="name" name="user_name" />
</p>
<p>
<label for="mail">E-mail:</label>
<input type="email" id="mail" name="user_mail" />
</p>
<p>
<label for="msg">Message:</label>
<textarea id="msg" name="user_message"></textarea>
</p>
<p class="button">
<button type="submit">Send your message</button>
</p>
</form>
</body>
</html>