使用 CSS3 设置列数或宽度
cssweb developmentfront end technology更新于 2024/11/17 16:12:17
使用 CSS3 中的 columns 属性设置列数和宽度。它是 column-width 和 column-count 属性的简写,设置为 −
columns: auto|column-width column-count|initial|inherit;
示例
让我们看一个设置列数的示例 −
<!DOCTYPE html>
<html>
<head>
<style>
.demo {
-webkit-columns: auto auto; /* Chrome, Safari, Opera */
-moz-columns: auto auto; /* Firefox */
columns: auto auto;
}
</style>
</head>
<body>
<h1>Machine Learning</h1>
<div class="demo">
Today’s Artificial Intelligence (AI) has far surpassed the hype of blockchain and quantum computing. This is due to the fact that huge computing resources are easily available to the common man. The developers now take advantage of this in creating new Machine Learning models and to re-train the existing models for better performance and results. The easy availability of High Performance Computing (HPC) has resulted in a sudden increased demand for IT professionals having Machine Learning skills.
</div>
</body>
</html>
输出

示例
现在让我们看另一个例子 −
<!DOCTYPE html>
<html>
<head>
<style>
.demo {
-webkit-columns: 40px 3; /* Chrome, Safari, Opera */
-moz-columns: 40px 3; /* Firefox */
columns: 40px 3;
}
</style>
</head>
<body>
<h1>Machine Learning</h1>
<div class="demo">
Today’s Artificial Intelligence (AI) has far surpassed the hype of blockchain and quantum computing. This is due to the fact that huge computing resources are easily available to the common man. The developers now take advantage of this in creating new Machine Learning models and to re-train the existing models for better performance and results. The easy availability of High Performance Computing (HPC) has resulted in a sudden increased demand for IT professionals having Machine Learning skills.
</div>
</body>
</html>
输出

相关文章
有用资源
css 参考教程 - 该教程包含有关 css 的更多信息:https://www.cainiaomax.com/css/

