Skip to content

Instantly share code, notes, and snippets.

@kyaido
Last active August 29, 2015 14:14
Show Gist options
  • Save kyaido/bad30b2231e889212ccd to your computer and use it in GitHub Desktop.
Save kyaido/bad30b2231e889212ccd to your computer and use it in GitHub Desktop.
数が決まってないリストでなんか罫線をうまいこと処理するやつ
<html>
<head>
<title>sample</title>
<style>
* {
margin: 0;
padding: 0;
list-style: none;
}
.list {
clear: both;
border-top: #eee 1px solid;
border-bottom: #eee 1px solid;
overflow: hidden;
}
.list li {
float: left;
width: 50%;
padding: 20px;
border-right: #eee 1px solid;
border-bottom: #eee 1px solid;
box-sizing: border-box;
}
.list li:last-child,
.list li:nth-child(2n+1):nth-last-child(2) {
border-bottom: none;
}
.list li:nth-child(2n) {
border-right: none;
}
.list li:nth-child(2n+1) {
clear: both;
}
.list li .trigger {
display: block;
padding: 15px;
}
</style>
</head>
<body>
<ul class="list">
<li>ダミーテキスト</li>
<li>ダミーテキスト</li>
<li>ダミーテキスト</li>
<li>ダミーテキスト</li>
<li>ダミーテキスト</li>
<li>ダミーテキスト</li>
<li>ダミーテキスト</li>
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment