我正在努力实现这一目标。
这是我的HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<ul>
<li>Full Time MBA</li>
<li>Part Time MBA</li>
<li>Executive MBA (EMBA)</li>
<li>Senior Executive MBA (SEMBA)</li>
<li>Master of Business Analytics</li>
<li>Master of Management Programs</li>
<li>Master of Internation Business </li>
<li>Specialist Masters</li>
<li>Research Higher Degrees</li>
<li>Executive Education</li>
</ul>
</body>
</html>
以下是我的CSS
ul{
list-style:none;
color:blue;
}
ul li:nth-child(n+6){
float:left;
margin-left:250px;
margin-top:0px;
color:green;
}
ul li:nth-last-child(-n+2){
color:red;
}
请帮忙。
答案 0 :(得分:2)
column-count
属性可以帮助您:
ul {
column-count: 3;
-moz-column-count: 3;
-webkit-column-count: 3;
column-gap: 60px;
-moz-column-gap: 60px;
-webkit-column-gap: 60px;
}
ul li {
-webkit-column-break-inside: avoid;
page-break-inside: avoid;
break-inside: avoid-column;
}
&#13;
<ul>
<li>Full Time MBA</li>
<li>Part Time MBA</li>
<li>Executive MBA (EMBA)</li>
<li>Senior Executive MBA (SEMBA)</li>
<li>Master of Business Analytics</li>
<li>Master of Management Programs</li>
<li>Master of Internation Business</li>
<li>Specialist Masters</li>
<li>Research Higher Degrees</li>
<li>Executive Education</li>
</ul>
&#13;