开发者

Dynamic Columns in CSS

开发者 https://www.devze.com 2022-12-16 08:53 出处:网络
I have dynamic elements that I would like to flow downward and fill over multiple columns (like in Word, for example) rather than float left or right or stack in the typical manner.Are there any funct

I have dynamic elements that I would like to flow downward and fill over multiple columns (like in Word, for example) rather than float left or right or stack in the typical manner. Are there any functions of CSS that make this possible? If not, what course of action 开发者_StackOverflow中文版can I take here?


It's possible but only in CSS3, which does not have the required market share yet to be used safely.

Check this article on Zen Elements for details.

A workaround until CSS3 is "mainstream" could be a Javascript/JQuery based solution like this one: Columnizer jQuery Plugin


what about an <li> that is floated left and display:inline-block ?


CSS3 makes it possible (explanation/description here), but it's not widely supported yet: only recent versions of Firefox and Safari (as well as other webkit-based browsers, probably) support it.

JavaScript is your best bet if you absolutely need this to be flexible and general. If you're doing it just for one specific piece of text, you could also hard-code it.

0

精彩评论

暂无评论...
验证码 换一张
取 消