简体   繁体   中英

Unix `ls` command style in CSS3

I am trying to get a very similar result of unix command ls in the browser in terms of the arrangement of the items.

Is there any suggestion based on the image below?

While width of the columns depends on the length of the text in that column, number of columns depends on the width of the window.

ls结果

CSS3 has a new property: column-count and it does exactly what ls does (provided you take care of the line breaks, of course). Just use it on your container element, define the size and you're good to go. You can also use column-gap to specify the gap between them.

Read more about it here: http://css-tricks.com/almanac/properties/c/columns/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM