如何指定元素应使用CSS划分的列数
要指定元素应划分的列数,请使用column-count属性。
您可以尝试运行以下代码以实现具有4列的column-count属性
示例
<!DOCTYPE html> <html> <head> <style> .demo { column-count: 4; } </style> </head> <body> <div class = "demo"> This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. This is demo text. </div> </body> </html>