Mail.ruПочтаМой МирОдноклассникиВКонтактеИгрыЗнакомстваНовостиКалендарьОблакоЗаметкиВсе проекты

Позиционирование элементов на странице

Максим Лео Знаток (348), открыт 2 недели назад
У меня есть список со значениями масштаба канваса, но он отображается криво. Я хочу чтобы он отображался вертикально вниз. Как это можно сделать?

 
 .geHeaderContainer{ 
display: flex;
position: fixed;
width: 100%;
}
.geToolbarContainer{
border-width: 1px;
overflow: hidden;
position: absolute;
cursor: default;
left: 0px;
right: 0px;
top: 64px;
height: 50px;
background-color: var(--primary-color);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.geToolbar{
padding-left: 16px;
padding-bottom: 3px;
margin-top: 7px;

}
.geSeparator{
float: left;
width: 1px;
height: 20px;
background: #e5e5e5;
margin-left: 8px;
margin-right: 6px;
margin-top: 4px;
}
.geLabel{
white-space: nowrap;
position: relative;
overflow: hidden;
width: 50px;
float: left;
margin: 2px;
padding: 3px 5px 3px 5px;
border: 1px solid transparent;
transition: all 0.1s ease-in-out;
}
.geToolbar a {
color: #000000;
text-decoration: none;
}
.geToolbarContainer img{
width:20px;
height:20px;
}

#scale-dropdown {
display: none; /* Скрываем выпадающий список по умолчанию */
}

#scale-dropdown.open {
display: flex;
}
.scale-option {
display: flex;
padding: 5px 10px;
cursor: pointer;
}
.scale-option:hover {
background-color: #f0f0f0; /* Цвет фона при наведении */
}
2 ответа
V̲i̲s̲t̲a̲s̲t̲e̲r̲ Искусственный Интеллект (246898) 2 недели назад
flex-direction:column
Максим ЛеоЗнаток (348) 2 недели назад
Пробовал,элементы просто исчезли,потому что им не хватает места. Я хочу сделать просто выпадающий список вертикальный
V̲i̲s̲t̲a̲s̲t̲e̲r̲ Искусственный Интеллект (246898) Максим Лео, меню надо писать однако, он само не появится)) пример там: https://codepen.io/VISTASTER/pen/LYoGBvr
CPT Просветленный (24307) 2 недели назад
To display the zoom scale options vertically, you need to modify the CSS for the #scale-dropdown element. You can use the flex-direction: column property to arrange the items vertically. Here's the updated CSS:
 #scale-dropdown {  
display: none; /* Скрываем выпадающий список по умолчанию */
flex-direction: column; /* Располагаем элементы вертикально */
}

#scale-dropdown.open {
display: flex;
flex-direction: column; /* Располагаем элементы вертикально */
}
.scale-option {
display: flex;
padding: 5px 10px;
cursor: pointer;
}
.scale-option:hover {
background-color: #f0f0f0; /* Цвет фона при наведении */
}
This CSS will ensure that the zoom scale options are displayed vertically when the dropdown is open.

Here's your complete CSS with the added modifications:
 .geHeaderContainer{  
display: flex;
position: fixed;
width: 100%;
}
.geToolbarContainer{
border-width: 1px;
overflow: hidden;
position: absolute;
cursor: default;
left: 0px;
right: 0px;
top: 64px;
height: 50px;
background-color: var(--primary-color);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.geToolbar{
padding-left: 16px;
padding-bottom: 3px;
margin-top: 7px;
}
.geSeparator{
float: left;
width: 1px;
height: 20px;
background: #e5e5e5;
margin-left: 8px;
margin-right: 6px;
margin-top: 4px;
}
.geLabel{
white-space: nowrap;
position: relative;
overflow: hidden;
width: 50px;
float: left;
margin: 2px;
padding: 3px 5px 3px 5px;
border: 1px solid transparent;
transition: all 0.1s ease-in-out;
}
.geToolbar a {
color: #000000;
text-decoration: none;
}
.geToolbarContainer img{
width:20px;
height:20px;
}

#scale-dropdown {
display: none; /* Скрываем выпадающий список по умолчанию */
flex-direction: column; /* Располагаем элементы вертикально */
}

#scale-dropdown.open {
display: flex;
flex-direction: column; /* Располагаем элементы вертикально */
}
.scale-option {
display: flex;
padding: 5px 10px;
cursor: pointer;
}
.scale-option:hover {
background-color: #f0f0f0; /* Цвет фона при наведении */
}
Add this CSS to your existing stylesheet to ensure the zoom scale options are displayed correctly.
Похожие вопросы