Skip to content

Instantly share code, notes, and snippets.

@mqxu
Created November 3, 2019 12:12
Show Gist options
  • Save mqxu/1ce45b2df76fb471a8d5dc107753a592 to your computer and use it in GitHub Desktop.
Save mqxu/1ce45b2df76fb471a8d5dc107753a592 to your computer and use it in GitHub Desktop.
【iCSS:布局】使用margin-left排版左重右轻列表
<div class="bruce flex-ct-x">
<ul class="left-list">
<li>Alibaba</li>
<li>Tencent</li>
<li>Baidu</li>
<li>Jingdong</li>
<li>Ant</li>
<li>Netease</li>
</ul>
</div>
.left-list {
display: flex;
align-items: center;
padding: 0 10px;
width: 600px;
height: 60px;
background-color: #3c9;
li {
padding: 0 10px;
height: 40px;
background-color: #3c9;
line-height: 40px;
font-size: 16px;
color: #fff;
& + li {
margin-left: 10px;
}
&:last-child {
margin-left: auto;
}
}
}
<link href="https://yangzw.vip/static/css/reset.css" rel="stylesheet" />
<link href="https://yangzw.vip/static/css/main.css" rel="stylesheet" />
<link href="https://yangzw.vip/static/css/theme.scss" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment