Разбираемся в CSS
Anonymous
Охватывает элемент списка в упорядоченном списке, который я хочу скрыть, если его первый или последний элемент списка
Сообщение
Anonymous » 23 июн 2025, 22:26
У меня есть упорядоченный список, который выглядит следующим образом: < /p>
Код: Выделить всё
.trash-btn {
width: 33px;
height: 40px;
margin-top: 10px;
margin-right: 30px;
background-image: url('../images/trash.png');
background-size: cover;
background-color: DimGray;
border: 0;
}
.up-btn {
width: 40px;
height: 40px;
margin-top: 10px;
margin-right: 30px;
background-image: url('../images/up.png');
background-size: cover;
background-color: DimGray;
border: 0;
display: inline;
}
.down-btn {
width: 40px;
height: 40px;
margin-top: 10px;
margin-right: 30px;
background-image: url('../images/down.png');
background-size: cover;
background-color: DimGray;
border: 0;
display: inline;
}
.span-right {
display: inline-block;
float: right;
background-position: center;
vertical-align: middle;
}
li.no-num {
list-style-type: none;
}
li.region-list {
background: #5e5e5e;
color: rgb(250, 250, 250);
padding: 10px;
border-radius: 20px;
height: 70px;
font-family: Verdana, Geneva, Tahoma, sans-serif;
}
ol li::before {
content: '';
width: 50px;
height: 70px;
display: inline-block;
margin-right: 5px;
z-index: 10;
background-position: center;
vertical-align: middle;
}
ol#sectionList:first-child #up-btn {
display: none;
}
ol#sectionList:last-child #down-btn {
display: none;
}< /code>
[list]
Item 1
Item 2
Item 3
[/list]< /code>
< /div>
< /div>
< /p>
Чего я пытаюсь достичь, так это то, что стрелка UP скрыта у первого ребенка, а кнопка «Стрелка» скрыта для последнего ребенка. < /p>
Подробнее здесь: [url]https://stackoverflow.com/questions/79675924/spans-inside-a-list-item-in-an-ordered-list-that-i-wish-to-hide-if-its-first-or[/url]
1750706806
Anonymous
У меня есть упорядоченный список, который выглядит следующим образом: < /p> [code].trash-btn { width: 33px; height: 40px; margin-top: 10px; margin-right: 30px; background-image: url('../images/trash.png'); background-size: cover; background-color: DimGray; border: 0; } .up-btn { width: 40px; height: 40px; margin-top: 10px; margin-right: 30px; background-image: url('../images/up.png'); background-size: cover; background-color: DimGray; border: 0; display: inline; } .down-btn { width: 40px; height: 40px; margin-top: 10px; margin-right: 30px; background-image: url('../images/down.png'); background-size: cover; background-color: DimGray; border: 0; display: inline; } .span-right { display: inline-block; float: right; background-position: center; vertical-align: middle; } li.no-num { list-style-type: none; } li.region-list { background: #5e5e5e; color: rgb(250, 250, 250); padding: 10px; border-radius: 20px; height: 70px; font-family: Verdana, Geneva, Tahoma, sans-serif; } ol li::before { content: ''; width: 50px; height: 70px; display: inline-block; margin-right: 5px; z-index: 10; background-position: center; vertical-align: middle; } ol#sectionList:first-child #up-btn { display: none; } ol#sectionList:last-child #down-btn { display: none; }< /code> [list] Item 1 Item 2 Item 3 [/list]< /code> < /div> < /div> < /p> Чего я пытаюсь достичь, так это то, что стрелка UP скрыта у первого ребенка, а кнопка «Стрелка» скрыта для последнего ребенка. < /p> Подробнее здесь: [url]https://stackoverflow.com/questions/79675924/spans-inside-a-list-item-in-an-ordered-list-that-i-wish-to-hide-if-its-first-or[/url]
0 Ответы
5 Просмотры
Последнее сообщение Anonymous
23 июн 2025, 12:17
0 Ответы
7 Просмотры
Последнее сообщение Anonymous
23 июн 2025, 12:17
0 Ответы
9 Просмотры
Последнее сообщение Anonymous
23 июн 2025, 12:49
0 Ответы
3 Просмотры
Последнее сообщение Anonymous
23 июн 2025, 22:26
Первый и последний элемент Python в списке
Anonymous »
10 янв 2025, 16:16 » в форуме
Python
Есть ли способ разрезать только первый и последний элемент списка?
Например; Если это мой список:
>>> some_list
Я хочу сделать это (очевидно, недопустимый синтаксис):
>>> first_item, last_item = some_list
>>> print first_item
'1'
>>> print...
0 Ответы
16 Просмотры
Последнее сообщение Anonymous
10 янв 2025, 16:16