/
llrr
/
lab5
Обзор
Документация
Войти
/
llrr
/
lab5
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
style.css
400 строк
8 KB
llrr
Create: index.html, style.css, normalizion.css
14 июн 2026, 22:14
Верифицирован
14 июн 2026, 22:14
ce496f0
Код
Авторство
О чём код?
/* Подключение шрифта Google Fonts (с поддержкой кириллицы) */ @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700;900&display=swap'); /* Глобальные стили */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Roboto', sans-serif; /* ОТНОСИТЕЛЬНЫЕ ЕДИНИЦЫ ИЗМЕРЕНИЯ */ font-size: 1.125rem; /* 18px (1rem = 16px) */ font-weight: 400; line-height: 1.6; text-align: left; /* РАЗНЫЕ СПОСОБЫ ЗАДАНИЯ ЦВЕТА */ color: #1e2a3a; /* HEX */ background-color: rgb(245, 247, 250); /* RGB */ /* РАЗМЕРЫ в относительных единицах */ max-width: 75rem; /* 1200px */ min-width: 20rem; /* 320px */ width: 90%; margin: 0 auto; padding: 1.25rem; position: relative; } /* Заголовки */ h1, h2, h3 { font-weight: 700; text-align: center; margin-bottom: 1.25rem; color: #0d3b66; } h1 { /* ОТНОСИТЕЛЬНЫЕ ЕДИНИЦЫ */ font-size: 2.5rem; /* 40px */ margin-top: 0; } h2 { font-size: 2rem; /* 32px */ border-bottom: 0.1875rem solid #0d3b66; display: inline-block; padding-bottom: 0.3125rem; } /* Навигация - FLEXBOX */ nav { background-color: #0d3b66; padding: 0.9375rem; /* FLEXBOX для навигации */ 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: rgba(255, 255, 255, 1); /* RGBA - белый */ text-decoration: none; font-weight: 500; padding: 0.5rem 1rem; transition: all 0.3s ease; } nav a:hover { color: hsl(42, 100%, 50%); /* HSL - золотой */ background-color: rgba(255, 255, 255, 0.1); border-radius: 1.25rem; } /* Секции */ section { background-color: 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: #0d3b66; background-color: white; padding: 0 0.625rem; border-radius: 50%; z-index: 1; } /* Изображение */ 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; } /* ========== FLEXBOX: ГАЛЕРЕЯ ========== */ .gallery-container { /* FLEXBOX КОНТЕЙНЕР */ display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 1.5rem; margin-top: 1.875rem; } .gallery-card { /* FLEX ЭЛЕМЕНТЫ */ flex: 1 1 250px; /* flex-grow: 1, flex-shrink: 1, flex-basis: 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); /* Внутренний flex для центрирования */ 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: #0d3b66; } .gallery-card p { font-size: 0.875rem; color: #4a5568; text-align: center; } /* ========== FLEXBOX: ИНТЕРЕСНЫЕ ФАКТЫ ========== */ .facts-container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; } .fact-item { /* FLEX ЭЛЕМЕНТ */ 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: #0d3b66; margin-bottom: 0.5rem; } .fact-item p { margin: 0; font-size: 0.875rem; } /* Контейнер для ссылок (flex) */ .links-container { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; } /* Стили для списка */ ul { margin: 1.25rem 0 1.25rem 1.875rem; } li { margin-bottom: 0.625rem; } li strong { color: #0d3b66; } /* Стили для ссылок в секции достопримечательностей */ section#attractions a { display: inline-block; margin: 0.625rem 0; padding: 0.5rem 0.9375rem; background-color: #e9ecef; border-radius: 1.5625rem; font-weight: bold; transition: all 0.3s ease; } section#attractions a:hover { background-color: #0d3b66; color: white; text-decoration: none; } /* ========== FOOTER С FLEXBOX ========== */ footer { background-color: #0d3b66; color: white; margin-top: 2.5rem; border-radius: 0.625rem; width: 100%; } .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: #f0a500; } .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: #0d3b66; 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: #1e6f5c; 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; } }