Загрузка данных
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Регистрация на конференцию</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<main class="container">
<h1>IT-конференция</h1>
<p class="subtitle">
Регистрация участника
</p>
<form action="#" method="post">
<label for="fullname">ФИО</label>
<input
type="text"
id="fullname"
name="fullname"
placeholder="Введите ФИО"
required
>
<label for="email">Email</label>
<input
type="email"
id="email"
name="email"
placeholder="example@mail.ru"
required
>
<label for="track">Выберите трек</label>
<select id="track" name="track" required>
<option value="">Выберите направление</option>
<option value="frontend">Frontend</option>
<option value="backend">Backend</option>
<option value="design">Design</option>
</select>
<label class="agreement">
<input
type="checkbox"
name="agreement"
required
>
<span>
Я согласен на обработку персональных данных
</span>
</label>
<button type="submit">
Зарегистрироваться
</button>
</form>
</main>
</body>
</html>
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
font-family: Arial, sans-serif;
background: linear-gradient(135deg, #dbeafe, #ede9fe);
color: #222;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
}
.container {
width: 100%;
max-width: 500px;
background-color: white;
padding: 30px;
border-radius: 15px;
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
h1 {
margin: 0;
text-align: center;
color: #4f46e5;
}
.subtitle {
margin: 10px 0 25px;
text-align: center;
color: #777;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-top: 15px;
margin-bottom: 6px;
font-weight: bold;
}
input[type="text"],
input[type="email"],
select {
width: 100%;
padding: 12px;
font-size: 16px;
border: 2px solid #d1d5db;
border-radius: 8px;
outline: none;
transition: 0.3s;
}
/* Изменение поля при клике */
input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
border-color: #6366f1;
box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}
/* Красная рамка у незаполненных полей */
input:required:invalid,
select:required:invalid {
border-color: #ef4444;
}
/* Зеленая рамка у правильно заполненных полей */
input:required:valid,
select:required:valid {
border-color: #22c55e;
}
/* Блок с чекбоксом */
.agreement {
display: flex;
align-items: center;
gap: 8px;
font-weight: normal;
}
.agreement input {
width: 18px;
height: 18px;
}
/* Кнопка */
button {
margin-top: 25px;
padding: 13px;
border: none;
border-radius: 8px;
background-color: #6366f1;
color: white;
font-size: 16px;
font-weight: bold;
cursor: pointer;
transition: 0.3s;
}
/* Наведение мыши */
button:hover {
background-color: #4f46e5;
}
/* Нажатие кнопки */
button:active {
transform: scale(0.96);
}