/
ikurakin
/
Table_with_HTML_and_CSS
Обзор
Документация
Войти
/
ikurakin
/
Table_with_HTML_and_CSS
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
style.css
474 строки
8 KB
Куракин Илья
Исходная версия HTML/CSS
10 янв 2026, 19:16
10 янв 2026, 19:16
1ff0ba4
Код
Авторство
О чём код?
/* Общие стили */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Roboto', sans-serif; background-color: #f5f7fa; color: #333; line-height: 1.6; padding: 20px; min-height: 100vh; } .container { max-width: 1200px; margin: 0 auto; } /* Шапка */ .header { text-align: center; margin-bottom: 30px; padding: 25px; background-color: #4CAF50; border-radius: 10px; color: white; box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3); } .header__title { font-family: 'Montserrat', sans-serif; font-size: 2.2rem; font-weight: 700; margin-bottom: 10px; } .header__subtitle { font-size: 1.1rem; font-weight: 300; margin-bottom: 20px; opacity: 0.9; } .header__info { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin-top: 20px; } .info-item { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; background-color: rgba(255, 255, 255, 0.2); padding: 8px 15px; border-radius: 5px; } .info-marker { width: 12px; height: 12px; border-radius: 50%; display: inline-block; } .discount-marker { background-color: #ff5252; } .eco-marker { background-color: #4caf50; } /* Основной контент */ .main-content { margin-bottom: 40px; } .table-container { overflow-x: auto; border-radius: 10px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); background-color: white; } /* Таблица */ .price-table { width: 100%; border-collapse: collapse; font-size: 1rem; } .table-caption { caption-side: top; text-align: center; font-size: 1.1rem; font-weight: 600; color: #555; padding: 15px; background-color: #f9f9f9; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom: 2px solid #eaeaea; } /* Заголовок таблицы */ .table-header { background-color: #6a89cc; color: white; } .table-header th { padding: 16px 12px; text-align: left; font-weight: 600; font-family: 'Montserrat', sans-serif; border-right: 1px solid rgba(255, 255, 255, 0.2); } .table-header th:last-child { border-right: none; } /* Ячейки категорий */ .category-cell { vertical-align: middle; text-align: center; font-weight: 700; font-family: 'Montserrat', sans-serif; font-size: 1.1rem; width: 180px; border-right: 2px solid #eaeaea; } .category-content { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px; } /* Стили для разных категорий */ .citrus-category { background-color: rgba(255, 193, 7, 0.15); color: #ff9800; } .exotic-category { background-color: rgba(156, 39, 176, 0.15); color: #9c27b0; } .berries-category { background-color: rgba(233, 30, 99, 0.15); color: #e91e63; } .stone-category { background-color: rgba(76, 175, 80, 0.15); color: #4caf50; } /* Строки с данными */ .data-row, .category-row { border-bottom: 1px solid #f0f0f0; } .data-row:nth-child(even) { background-color: #f9f9f9; } .data-row:hover, .category-row:hover { background-color: #f0f7ff; } /* Ячейки с данными */ .price-table td { padding: 14px 12px; vertical-align: middle; } .fruit-name { font-weight: 500; } .fruit-origin { color: #666; } .fruit-price { font-weight: 700; font-size: 1.1rem; color: #2c3e50; } .discount-price { color: #e53935; font-weight: 700; } .old-price { text-decoration: line-through; color: #999; font-weight: 400; font-size: 0.9rem; margin-right: 8px; } /* Бейджи */ .discount-badge { background-color: #ff5252; color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; margin-left: 8px; } .discount-badge.small { padding: 3px 6px; font-size: 0.7rem; } .season-badge { padding: 6px 10px; border-radius: 4px; font-size: 0.85rem; font-weight: 500; display: inline-block; } .year-round { background-color: #e3f2fd; color: #1976d2; border: 1px solid #bbdefb; } .summer { background-color: #fff3e0; color: #f57c00; border: 1px solid #ffe0b2; } .autumn { background-color: #f3e5f5; color: #7b1fa2; border: 1px solid #e1bee7; } .winter { background-color: #e8eaf6; color: #3949ab; border: 1px solid #c5cae9; } /* Наличие товаров */ .fruit-availability { font-weight: 500; } .in-stock { color: #43a047; } .low-stock { color: #ff9800; } .out-of-stock { color: #e53935; } /* Подвал таблицы */ .table-footer { background-color: #2c3e50; color: white; } .table-footer td { padding: 16px 20px; font-weight: 500; } .footer-info, .footer-note { display: flex; align-items: center; gap: 10px; } .footer-info { border-right: 1px solid rgba(255, 255, 255, 0.2); } .footer-icon { font-size: 1.2rem; } .highlight { font-weight: 700; color: #ffeb3b; font-size: 1.2rem; } /* Легенда */ .legend { padding: 20px; background-color: #f9f9f9; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; border-top: 2px solid #eaeaea; } .legend-title { font-family: 'Montserrat', sans-serif; font-size: 1.2rem; margin-bottom: 15px; color: #555; } .legend-items { display: flex; flex-wrap: wrap; gap: 20px; } .legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: #666; } .legend-color { width: 18px; height: 18px; border-radius: 3px; } .availability-in-stock { background-color: #43a047; } .availability-low { background-color: #ff9800; } .availability-out { background-color: #e53935; } /* Футер */ .footer { text-align: center; padding: 20px; color: #666; font-size: 0.95rem; background-color: white; border-radius: 10px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05); } .footer-contacts { margin-top: 10px; display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; } /* Адаптивность */ @media (max-width: 992px) { .header__title { font-size: 1.8rem; } .table-header th { padding: 14px 10px; font-size: 0.95rem; } .price-table td { padding: 12px 10px; } .category-cell { width: 150px; } } @media (max-width: 768px) { .header__title { font-size: 1.6rem; } .header__info { flex-direction: column; align-items: center; gap: 15px; } .category-cell { width: 120px; font-size: 1rem; } .footer-contacts { flex-direction: column; gap: 10px; } .table-footer td { padding: 14px 10px; font-size: 0.9rem; } .legend-items { flex-direction: column; gap: 12px; } } @media (max-width: 576px) { body { padding: 10px; } .header { padding: 20px 15px; } .header__title { font-size: 1.4rem; } .header__subtitle { font-size: 1rem; } .price-table { font-size: 0.9rem; } .table-header th { padding: 12px 8px; font-size: 0.85rem; } .price-table td { padding: 10px 8px; } .category-cell { width: 100px; font-size: 0.9rem; } .season-badge, .discount-badge { font-size: 0.7rem; padding: 4px 6px; } .footer-contacts { font-size: 0.9rem; } }