Computer >> Máy Tính >  >> Lập trình >> CSS

Đặt Khoảng cách cột bằng CSS3

Để đặt khoảng cách cột bằng CSS3, hãy sử dụng thuộc tính cột-khoảng cách. Bạn có thể đặt các giá trị là -

column-gap: length|normal|initial|inherit;

Ví dụ

<!DOCTYPE html>
<html>
<head>
<style>
.demo {
   column-count: 4;
   -webkit-column-count: 4; /* Chrome, Safari, Opera */
   -moz-column-count: 4; /* Firefox */
   -webkit-column-gap: 25px; /* Chrome, Safari, Opera */
   -moz-column-gap: 25px; /* Firefox */
   column-gap: 25px;
}
</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>

Đầu ra

Đặt Khoảng cách cột bằng CSS3

Ví dụ

Bây giờ chúng ta hãy xem một ví dụ khác -

<!DOCTYPE html>
<html>
<head>
<style>
.demo {
   column-count: 2;
   -webkit-column-count: 2; /* Chrome, Safari, Opera */
   -moz-column-count: 2; /* Firefox */
   -webkit-column-gap: normal; /* Chrome, Safari, Opera */
   -moz-column-gap: normal; /* Firefox */
   column-gap: normal;
}
</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>

Đầu ra

Đặt Khoảng cách cột bằng CSS3