/
htmlcss_education
/
Lesson_7
Обзор
Документация
Войти
/
htmlcss_education
/
Lesson_7
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
master
style.css
292 строки
6 KB
Куракин Илья
Домашнее задание к уроку
23 дек 2025, 22:07
23 дек 2025, 22:07
2dd4b5e
Код
Авторство
О чём код?
/* Базовые стили (НЕ МЕНЯТЬ) */ * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; color: #333; background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); padding: 20px; min-height: 100vh; } .header { text-align: center; margin-bottom: 40px; padding: 20px; background: white; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .header h1 { color: #2c3e50; margin-bottom: 10px; } .header p { color: #7f8c8d; } .demo-section { background: white; padding: 30px; margin-bottom: 30px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .demo-section h2 { color: #3498db; margin-bottom: 10px; border-bottom: 2px solid #3498db; padding-bottom: 10px; } .example { margin: 25px 0; padding: 20px; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #3498db; } .example h3 { color: #2c3e50; margin-bottom: 15px; font-size: 1.1em; } /* Демонстрационные контейнеры - ГОТОВЫЕ ПРИМЕРЫ */ .container { height: 120px; background: #ecf0f1; border: 2px dashed #bdc3c7; border-radius: 8px; padding: 10px; margin-bottom: 10px; } .tall-container { height: 200px; } .box, .tall-box { background: #3498db; color: white; width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: bold; border-radius: 5px; } .tall-box { height: 60px; background: #e74c3c; } /* ДЕМОНСТРАЦИЯ justify-content (ГОТОВО) */ .demo-justify-start { display: flex; justify-content: flex-start; } .demo-justify-center { display: flex; justify-content: center; } .demo-justify-end { display: flex; justify-content: flex-end; } .demo-justify-between { display: flex; justify-content: space-between; } .demo-justify-around { display: flex; justify-content: space-around; } /* ДЕМОНСТРАЦИЯ align-items (ГОТОВО) */ .demo-align-stretch { display: flex; align-items: stretch; } .demo-align-start { display: flex; align-items: flex-start; } .demo-align-center { display: flex; align-items: center; } .demo-align-end { display: flex; align-items: flex-end; } /* Практическая секция */ .practice-section { background: white; padding: 30px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .practice-section h2 { color: #2ecc71; margin-bottom: 20px; border-bottom: 2px solid #2ecc71; padding-bottom: 10px; } .tasks { display: flex; flex-direction: column; gap: 30px; } .task { padding: 25px; background: #f8f9fa; border-radius: 8px; border: 1px solid #dee2e6; } .task h3 { color: #2c3e50; margin-bottom: 15px; } .task p { color: #666; margin-bottom: 20px; font-size: 0.95em; } /* Элементы для практических задач (СТИЛЬ ГОТОВ, FLEX-свойства добавляет студент) */ /* Задача 1: Навигация */ .navigation { background: #34495e; padding: 15px; border-radius: 5px; /* Студент должен добавить сюда display: flex и justify-content */ } .navigation a { color: white; text-decoration: none; padding: 10px 20px; background: #3498db; border-radius: 4px; transition: background 0.3s; } .navigation a:hover { background: #2980b9; } /* Задача 2: Карточки */ .cards { /* Студент должен добавить сюда display: flex, justify-content и align-items */ gap: 20px; } .card { background: white; border: 1px solid #ddd; border-radius: 8px; padding: 20px; width: 200px; text-align: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); } .card-img { font-size: 48px; margin-bottom: 15px; } .card h4 { color: #2c3e50; margin-bottom: 10px; } .card p { color: #e74c3c; font-weight: bold; font-size: 1.2em; } /* Задача 3: Профиль пользователя */ .user-profile { background: white; border: 1px solid #ddd; border-radius: 8px; padding: 20px; /* Студент должен добавить сюда display: flex, justify-content и align-items */ } .user-avatar { font-size: 60px; background: #f1c40f; width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; } .user-info { flex: 1; } .user-info h4 { color: #2c3e50; margin-bottom: 5px; font-size: 1.2em; } .user-info p { color: #7f8c8d; } /* === ВАША РАБОТА НИЖЕ === */ /* Задача 1: Навигационное меню */ /* Сделайте навигацию flex-контейнером. Элементы должны быть равномерно распределены по всей ширине. */ .navigation { /* Добавьте ваш код здесь */ } /* Задача 2: Карточки товаров */ /* Сделайте контейнер карточек flex-контейнером с переносом строк. Выровняйте карточки по центру по горизонтали и по вертикали. */ .cards { /* Добавьте ваш код здесь */ } /* Задача 3: Профиль пользователя */ /* Сделайте контейнер профиля flex-контейнером. Аватар и текст должны быть выровнены по центру вертикально и разнесены к противоположным краям горизонтально. */ .user-profile { /* Добавьте ваш код здесь */ }