A Pen by JowayYoung on CodePen.
Created
November 3, 2019 12:12
-
-
Save mqxu/1ce45b2df76fb471a8d5dc107753a592 to your computer and use it in GitHub Desktop.
【iCSS:布局】使用margin-left排版左重右轻列表
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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