/
llrr
/
lab8
Обзор
Документация
Войти
/
llrr
/
lab8
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
style.css
686 строк
14 KB
llrr
Create: index.html, form.html, normalizion.css, style.css
15 июн 2026, 00:19
Верифицирован
15 июн 2026, 00:19
ab40644
Код
Авторство
О чём код?
/* Подключение шрифта Google Fonts */ @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700;900&display=swap'); /* ========== ПСЕВДОКЛАСС :ROOT ========== */ :root { --primary-color: #0d3b66; --secondary-color: #1e6f5c; --accent-color: #f0a500; --text-color: #1e2a3a; --bg-color: #f5f7fa; --white: #ffffff; --error-color: #e74c3c; --success-color: #27ae60; } /* Глобальные стили */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Roboto', sans-serif; font-size: 1.125rem; font-weight: 400; line-height: 1.6; text-align: left; color: var(--text-color); background-color: var(--bg-color); max-width: 75rem; min-width: 20rem; width: 90%; margin: 0 auto; padding: 1.25rem; position: relative; } /* ========== ПСЕВДОЭЛЕМЕНТ ::SELECTION ========== */ ::selection { background-color: var(--accent-color); color: var(--primary-color); } ::-moz-selection { background-color: var(--accent-color); color: var(--primary-color); } /* ========== ПСЕВДОЭЛЕМЕНТЫ ::FIRST-LETTER И ::FIRST-LINE ========== */ h1::first-letter { font-size: 3rem; color: var(--accent-color); } h2::first-line { color: var(--primary-color); font-weight: bold; } /* ========== ПСЕВДОКЛАССЫ ДЛЯ ССЫЛОК ========== */ a:link { color: var(--secondary-color); text-decoration: none; } a:visited { color: #6c3483; } a:hover { color: var(--accent-color); text-decoration: underline; } a:active { color: var(--error-color); } a:focus { outline: 2px solid var(--accent-color); outline-offset: 2px; border-radius: 4px; } /* Навигация */ nav { background-color: var(--primary-color); padding: 0.9375rem; display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap; border-radius: 0.625rem; margin: 1.25rem 0; position: sticky; top: 0; z-index: 100; } nav a { color: white; text-decoration: none; font-weight: 500; padding: 0.5rem 1rem; transition: all 0.3s ease; } nav a:hover { color: var(--accent-color); background-color: rgba(255, 255, 255, 0.1); border-radius: 1.25rem; } /* Секции с псевдоэлементами ::before и ::after */ section { background-color: var(--white); padding: 1.5625rem; margin-bottom: 1.875rem; border: 0.0625rem solid #d1d8e0; border-radius: 0.9375rem; box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.05); width: 100%; min-height: 15.625rem; position: relative; } section::before { content: "★"; position: absolute; top: -0.9375rem; left: 1.25rem; font-size: 1.875rem; color: var(--primary-color); background-color: var(--white); padding: 0 0.625rem; border-radius: 50%; z-index: 1; } section::after { content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 0.25rem; background: linear-gradient(90deg, var(--primary-color), var(--accent-color)); border-radius: 0 0 0.9375rem 0.9375rem; } /* Изображение */ img { display: block; max-width: 100%; min-width: 12.5rem; height: auto; max-height: 31.25rem; width: 80%; margin: 1.25rem auto; border-radius: 0.75rem; border: 0.125rem solid #d1d8e0; position: relative; } img:hover { transform: scale(1.02); transition: transform 0.3s ease; } .image-wrapper { position: relative; display: block; width: 100%; text-align: center; } .image-caption { position: absolute; bottom: 0.625rem; left: 50%; transform: translateX(-50%); background-color: rgba(0, 0, 0, 0.7); color: rgb(255, 255, 255); padding: 0.3125rem 0.9375rem; border-radius: 1.25rem; font-size: 0.875rem; z-index: 2; } /* ========== СТИЛИЗАЦИЯ СПИСКА (ЧЕТНЫЕ/НЕЧЕТНЫЕ) ========== */ .styled-list { list-style: none; padding: 0; margin: 1.25rem 0; } .styled-list li { padding: 0.75rem 1rem; margin-bottom: 0.5rem; border-radius: 0.625rem; transition: all 0.3s ease; } /* Нечетные элементы (nth-child(odd)) */ .styled-list li:nth-child(odd) { background-color: #e8f0fe; border-left: 0.25rem solid var(--primary-color); } /* Четные элементы (nth-child(even)) */ .styled-list li:nth-child(even) { background-color: #fef5e8; border-left: 0.25rem solid var(--accent-color); } /* Первый и последний элементы */ .styled-list li:first-child { font-weight: bold; } .styled-list li:last-child { margin-bottom: 0; } /* Эффект при наведении */ .styled-list li:hover { transform: translateX(0.625rem); box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1); } /* Псевдоэлемент ::before для маркеров списка */ .styled-list li::before { content: "📍"; margin-right: 0.625rem; } /* Галерея */ .gallery-container { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 1.5rem; margin-top: 1.875rem; } .gallery-card { flex: 1 1 250px; min-width: 200px; max-width: 300px; background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%); border-radius: 1rem; padding: 1.25rem; text-align: center; transition: transform 0.3s ease; box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; align-items: center; } .gallery-card:hover { transform: translateY(-0.625rem); } .card-image { font-size: 3rem; margin-bottom: 0.9375rem; } .gallery-card h3 { font-size: 1.25rem; margin-bottom: 0.625rem; color: var(--primary-color); } /* Факты */ .facts-container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; } .fact-item { flex: 1 1 180px; min-width: 150px; background: rgba(13, 59, 102, 0.1); border-radius: 0.75rem; padding: 1rem; text-align: center; transition: all 0.3s ease; } .fact-item:hover { background: rgba(13, 59, 102, 0.2); transform: scale(1.05); } .fact-number { display: block; font-size: 2rem; font-weight: 700; color: var(--primary-color); margin-bottom: 0.5rem; } .links-container { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; } /* ========== СТИЛИ ДЛЯ ФОРМЫ ========== */ .form-page { display: flex; flex-direction: column; min-height: 100vh; } .form-main { flex: 1; padding: 2rem 0; } .registration-form { max-width: 800px; margin: 0 auto; background: var(--white); border-radius: 20px; padding: 2rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); } .registration-form fieldset { border: 2px solid #e0e4e8; border-radius: 15px; padding: 1.5rem; margin-bottom: 2rem; } .registration-form legend { padding: 0 1rem; font-size: 1.3rem; font-weight: bold; color: var(--primary-color); background: var(--white); border-radius: 30px; } .form-group { margin-bottom: 1.5rem; } .form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--text-color); } /* Стили для полей ввода */ .form-group input, .form-group select { width: 100%; padding: 0.75rem 1rem; border: 2px solid #d1d8e0; border-radius: 10px; font-size: 1rem; transition: all 0.3s ease; } .form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(13, 59, 102, 0.1); } /* Псевдокласс :focus для полей */ input:focus, select:focus, textarea:focus { background-color: #fffef5; } /* Псевдокласс :required для обязательных полей */ input:required { border-left: 4px solid var(--error-color); } input:required:valid { border-left: 4px solid var(--success-color); } /* Псевдоклассы :enabled и :disabled */ input:enabled { background-color: var(--white); } input:disabled { background-color: #e0e4e8; opacity: 0.6; } /* Псевдоэлемент ::placeholder */ ::placeholder { color: #b0bec5; font-style: italic; font-size: 0.875rem; } input::-webkit-input-placeholder { color: #b0bec5; font-style: italic; } input::-moz-placeholder { color: #b0bec5; font-style: italic; } input:focus::placeholder { color: transparent; } .required { color: var(--error-color); font-weight: bold; } .hint { display: block; font-size: 0.75rem; color: #7f8c8d; margin-top: 0.25rem; } /* Радиокнопки и чекбоксы */ .radio-group, .checkbox-group { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.5rem; } .radio-label, .checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: normal; cursor: pointer; transition: all 0.3s ease; } /* Псевдокласс :checked для радиокнопок */ input[type="radio"]:checked { accent-color: var(--primary-color); transform: scale(1.1); } .radio-label:has(input:checked) { color: var(--secondary-color); font-weight: bold; } /* Псевдокласс :checked для чекбоксов - текст должен быть вычеркнут */ input[type="checkbox"]:checked { accent-color: var(--primary-color); transform: scale(1.1); } .checkbox-label:has(input:checked) { text-decoration: line-through; color: #95a5a6; } /* Кнопки формы */ .form-buttons { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; } .btn-submit, .btn-reset { padding: 0.75rem 2rem; font-size: 1rem; font-weight: bold; border: none; border-radius: 50px; cursor: pointer; transition: all 0.3s ease; } .btn-submit { background-color: var(--primary-color); color: white; } .btn-submit:hover { background-color: var(--secondary-color); transform: scale(1.05); } .btn-submit:active { transform: scale(0.95); } .btn-submit:focus { outline: 3px solid var(--accent-color); outline-offset: 2px; } .btn-reset { background-color: #e0e4e8; color: var(--text-color); } .btn-reset:hover { background-color: var(--error-color); color: white; } .btn-reset:active { transform: scale(0.95); } .btn-reset:focus { outline: 3px solid var(--accent-color); outline-offset: 2px; } .form-note { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: #7f8c8d; } /* Футер */ footer { background-color: var(--primary-color); color: white; margin-top: 2.5rem; border-radius: 0.625rem; width: 100%; } .footer-fixed { margin-top: auto; } .footer-content { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 2rem; padding: 1.875rem; } .footer-section { flex: 1 1 200px; text-align: center; } .footer-section h4 { margin-bottom: 0.9375rem; font-size: 1.125rem; color: var(--accent-color); } .footer-section p { margin-bottom: 0.5rem; font-size: 0.875rem; text-align: center; } .footer-bottom { background-color: rgba(0, 0, 0, 0.2); text-align: center; padding: 0.9375rem; } .footer-bottom p { margin: 0; font-size: 0.75rem; } /* Плавающая кнопка */ .floating-button { position: fixed; bottom: 1.875rem; right: 1.875rem; background-color: var(--primary-color); color: white; width: 3.75rem; height: 3.75rem; border-radius: 50%; text-align: center; line-height: 3.75rem; font-size: 1.875rem; cursor: pointer; z-index: 1000; transition: all 0.3s ease; box-shadow: 0 0.25rem 0.9375rem rgba(0, 0, 0, 0.2); } .floating-button:hover { background-color: var(--secondary-color); transform: scale(1.1); } /* Адаптивность */ @media (max-width: 48rem) { body { font-size: 1rem; padding: 0.625rem; width: 95%; } h1 { font-size: 1.75rem; } section { padding: 0.9375rem; min-height: 12.5rem; } .floating-button { width: 3rem; height: 3rem; line-height: 3rem; font-size: 1.5rem; bottom: 1.25rem; right: 1.25rem; } nav { gap: 0.5rem; } nav a { padding: 0.375rem 0.75rem; font-size: 0.875rem; } .gallery-card { flex: 1 1 100%; max-width: 100%; } .fact-item { flex: 1 1 100%; } .footer-content { flex-direction: column; gap: 1rem; } .registration-form { padding: 1rem; margin: 0 1rem; } .form-buttons { flex-direction: column; } .btn-submit, .btn-reset { width: 100%; } .radio-group, .checkbox-group { flex-direction: column; gap: 0.5rem; } }