Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
}
160 changes: 151 additions & 9 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,159 @@
<!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 class="fs1">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

use required for one of your inputs

<legend>Personal information</legend>
<label class="label">
Surname:
<input
type="text"
name="surname"
minlength="3"
maxlength="20"
autocomplete="off"
>
</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.

follow code styling recommendations

Suggested change
<label class="label">
Surname:
<input
type="text"
name="surname"
minlength="3"
maxlength="20"
autocomplete="off"
>
</label>
<label class="label">
Surname:
<input
type="text"
name="surname"
minlength="3"
maxlength="20"
autocomplete="off"
>
</label>

<label class="label">
Name:
<input
type="text"
name="surname"
minlength="3"
maxlength="20"
autocomplete="off"
>
</label>
<label class="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.

add an empty line between multiline siblings

Suggested change
</label>
<label class="label">
</label>
<label class="label">

How old are you?
<input
type="number"
name="age"
min="1"
max="100"
value="12"
>
</label>
<label class="label">
Full date of birth:
<input
type="date"
name="date_of_birth"
>
</label>
<label class="label">
I accept the terms of the agreement
<input
type="checkbox"
name="agree"
>
</label>
</fieldset>

<fieldset class="fs1">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

redundant class

Suggested change
<fieldset class="fs1">
<fieldset>

<legend>Registration</legend>
<label class="label">
E-mail:
<input
type="email"
name="email"
placeholder="email@example.com"
>
</label>
<label class="label">
Password:
<input
type="password"
name="password"
>
</label>
</fieldset>

<fieldset class="fs1">
<legend>An interesting fact about you!</legend>
<label class="label">
Do you love cats?
<input
type="radio"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

each label/select should be wrapped with a label

Suggested change
<label class="label">
Do you love cats?
<input
type="radio"
<div class="label">
Do you love cats?
<label>
<input
type="radio"

id="yes"
name="cats"
value="yes"
>
Yes
<input
type="radio"
id="no"
name="cats"
value="no"
>
No
</label>
<label class="label">
What is your favorite color?
<input
type="color"
name="fcolor"
>
</label>
<label class="label">
What time do you go to bed?
<input
type="time"
name="go_to_bed"
>
</label>
<label class="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>
<label class="label">
How do you rate our work?
<input
type="range"
name="rate"
min="1"
max="100"
value="50"
>
</label>
</fieldset>

<fieldset class="fs1">
<legend>Additional info:</legend>
<label class="label">
Comments:
<textarea
name="comment"
></textarea>
</label>
<label class="fs1">
Would you recommend us?
<select
name="yes_or_no"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
name="yes_or_no"
name="recommendation"

>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
</label>
</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;
}

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

.fs1 {
margin-bottom: 20px;
}