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
48 changes: 47 additions & 1 deletion .linthtmlrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
{
"extends": "@mate-academy/linthtml-config"
"attr-bans": [
"align",
"background",
"bgcolor",
"border",
"frameborder",
"style"
],
"attr-name-ignore-regex": "viewBox",
"attr-no-dup": true,
"attr-quote-style": "double",
"attr-req-value": true,
"class-no-dup": true,
"doctype-first": true,
"doctype-html5": true,
"fig-req-figcaption": true,
"head-req-title": true,
"html-req-lang": true,
"id-class-style": false,
"id-no-dup": true,
"img-req-src": true,
"img-req-alt": "allownull",
"indent-width": 2,
"indent-style": "spaces",
"indent-width-cont": true,
"input-radio-req-name": true,
"spec-char-escape": true,
"tag-bans": [
"b",
"i",
"u",
"center",
"style",
"marquee",
"font",
"s"
],
"tag-name-lowercase": true,
"tag-name-match": true,
"tag-self-close": "never",
"tag-close": true,
"text-ignore-regex": "&",
"title-no-dup": true,
"line-end-style": "lf",
"attr-new-line": 2,
"attr-name-style": "dash",
"attr-no-unsafe-char": true
}
201 changes: 192 additions & 9 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,200 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>HTML Form</title>
<link rel="stylesheet" href="./style.css">
<title>The form</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>HTML Form</h1>
<script type="text/javascript" src="./main.js"></script>
<form
method="POST"
action="https://mate-academy-form-lesson.herokuapp.com/create-application"
>
<fieldset>
<legend>Personal information</legend>
<div class="label">
<label>
Surname:
<input
type="text"
name="surname"
minlength="3"
maxlength="20"
autocomplete="off"
required
>
</label>
</div>

<div class="label">
<label>
Name:
<input
type="text"
name="surname"
minlength="3"
maxlength="20"
autocomplete="off"
required
>
</label>
</div>

<div class="label">
<label class="label">
How old are you?
<input
type="number"
name="age"
min="1"
max="100"
value="12"
>
</label>
</div>

<div class="label">
<label>
Full date of birth:
<input
type="date"
name="date_of_birth"
>
</label>
</div>

<div class="label">
<label>
I accept the term of the agreement
<input
type="checkbox"
name="agree"
>
</label>
</div>
</fieldset>

<fieldset>
<legend>Registration</legend>
<div class="label">
<label>
E-mail:
<input
type="email"
name="email"
placeholder="[email protected]"
required
>
</label>
</div>

<div class="label">
<label>
Password:
<input
type="password"
name="password"
required
>
</label>
</div>
</fieldset>

<fieldset>
<legend>An interesting fact about you!</legend>
<div class="label">
<label>
Do you love cats?
<input
type="radio"
id="yes"
name="cats"
value="yes"
>
Yes
<input
type="radio"
id="no"
name="cats"
value="no"
>
No
</label>
</div>

<div class="label">
<label>
What is your favorite color?
<input
type="color"
name="fcolor"
>
</label>
</div>

<div class="label">
<label>
What time do you go to bed?
<input
type="time"
name="go_to_bed"
>
</label>
</div>

<div class="label">
<label>
What are you favorite brand of cars?
<select multiple name="cars">
<option value="bmw">BMW</option>
<option value="audi">Audi</option>
<option value="lada">Lada</option>
</select>
</label>
</div>

<div class="label">
<label>
How do you rate our work?
<input
type="range"
name="rate"
min="1"
max="100"
value="50"
>
</label>
</div>
</fieldset>


<fieldset>
<legend>Additional info:</legend>
<div class="label">
<label>
Comments:
<textarea
name="comment"
></textarea>
</label>
</div>

<div class="label">
<label>
Would you recommend us?
<select name="recomendation"
>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
</label>
</div>
</fieldset>
<button type="submit">
Submit
</button>
</form>
</body>
</html>
12 changes: 12 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
/* styles go here */
.label {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You may only apply those classes to your filedset and form field (label or div)
Example:

.fieldset:not(:last-child) {
  margin-bottom: 20px
}

.field:not(:last-child) {
  margin-bottom: 10px
}

display: block;
margin-bottom: 10px;
}

fieldset {
margin-bottom: 20px;
}

.label:last-child {
margin-bottom: 0;
}