Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Исправления для <optgroup> #5538

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 29 additions & 11 deletions html/optgroup/demos/styles/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,47 +6,65 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap">
<style>
*, *::before, *::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}

html {
color-scheme: dark;
}

body {
min-height: 100vh;
padding: 50px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 50px;
background-color: #18191c;
color: #FFFFFF;
font-family: "Roboto", sans-serif;
font-size: 18px;
}

label {
font-size: 24px;
font-weight: 500;
line-height: 1;
}

select {
width: 300px;
margin-top: 10px;
padding: 10px 15px;
font-size: 18px;
}

optgroup {
color: #0a0a59;
font-size: 20px;
background-color: #f4f4c9;
color: #FF8630;
font-size: 18px;
background-color: #000000;
}

@media (max-width: 768px) {
body {
padding: 30px;
flex-direction: column;
gap: 10px;
}
}
</style>
</head>
<body>
<label for="colors">Выберите оттенок синего цвета:</label>
<label for="colors">Выберите оттенок оранжевого:</label>
<select id="colors">
<optgroup label="Синие цвета">
<option>Васильковый цвет</option>
<option>Кобальтовый цвет</option>
<option>Ультрамариновый цвет</option>
<optgroup label="Оттенки оранжевого">
<option>Коралловый</option>
<option>Тыквенный</option>
<option>Морковный</option>
</optgroup>
</select>
</body>
Expand Down
7 changes: 3 additions & 4 deletions html/optgroup/practice/granondo.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
🛠 У тега `<optgroup>` не очень много вариантов стилизации, мы можем изменить фон и параметры текста. В зависимости от браузера и операционной системы стили работают по-разному. Или не работают вообще 😕

- ✅ — меняется
- ⛔ — не меняется
✅ — меняется, ⛔ — не меняется:

**Windows**

Expand Down Expand Up @@ -29,6 +28,6 @@

При этом, пока мы не выберем список, во всех браузерах и операционных системах он идёт стандартного серого цвета, для изменения стиля списка вам потребуется стилизовать тег [`<select>`](/html/select/).

Демо ниже поможет понять, поддерживаются ли стили в вашем браузере и операционной системе. Если текст заголовка группы не красного цвета, а фон у него не жёлтый, то поддержки нет.
Демо ниже поможет понять, поддерживаются ли стили в вашем браузере и операционной системе. Если текст заголовка группы не оранжевого цвета, а фон у него не чёрный, то поддержки нет.

<iframe title="Стилизация <optgroup>" src="../demos/styles/" height="450"></iframe>
<iframe title="Стилизация <optgroup>" src="../demos/styles/" height="350"></iframe>
Loading