Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Targeting nth column (made by column-count)

Let's say I have this

<ul>
    <li>test</li>
    <li>test</li>
    <li>test</li>
    <li>test</li>
    <li>test</li>
    <li>test</li>
</ul>


ul {
   column-count: 2;
}

and I want to align first column to right and the second to left, is there any way to target one of those columns using css selectors?

like image 350
fxck Avatar asked Jan 06 '14 17:01

fxck


People also ask

How do I target every nth column in a table?

It accepts the An+B notation such as used with the :nth-child selector, using this to target every nth column. The values odd and even are also valid.

What is the use of nth-Col in CSS?

The :nth-col () CSS pseudo-class is designed for tables and grids. It accepts the An+B notation such as used with the :nth-child selector, using this to target every nth column. The values odd and even are also valid. :nth-col (odd) { background-color: pink; }

What is the meaning of the column-width in the content box?

If the column-width is also set to a non- auto value, it merely indicates the maximum allowed number of columns. <p class="content-box"> This is a bunch of text split into three columns using the CSS `column-count` property.

How to determine the number of columns in an HTML page?

The number of columns is determined by other CSS properties, such as column-width. Is a strictly positive <integer> describing the ideal number of columns into which the content of the element will be flowed. If the column-width is also set to a non- auto value, it merely indicates the maximum allowed number of columns.


Video Answer


1 Answers

As of now, there is no way to target nth column with pure css.

like image 136
fxck Avatar answered Nov 03 '22 10:11

fxck