Код: Выделить всё
div {
width: 300px;
text-align: center;
}
p:not(.vrt) {
text-align: left;
}
p.vrt {
writing-mode: vertical-rl;
display: inline-block;
}
div :nth-child(1 of p.vrt) {
margin-left: 0;
}
div :nth-last-child(1 of p.vrt) {
margin-right: 0;
}
Код: Выделить всё
This is some sample text which is not meant to be read.
幾見本言葉
幾見本言葉
幾見本言葉
This is some sample text which is not meant to be read.
幾見本言葉
Что мне нужно сделать, так это выбрать CSS только первый элемент p.vrt (в группе элементов p.vrt), а другой выбирает только последний элемент p.vrt (в группе элементов p.vrt). В настоящее время мой CSS выбирает самый первый и самый последний элементы. В примере выше «первый» CSS выберет 1-й и 4-й p.vrt, а «последний» CSS выберет 3-й и 4-й p.vrt.
Подробнее здесь: https://stackoverflow.com/questions/783 ... r-elements
Мобильная версия