LoginSignup
1
2

More than 5 years have passed since last update.

break-inside:avoid-column

Posted at

段組セットが崩れた場合はbreak-insideを指定する。

.pair{columns:16rem}
.pair>li{break-inside: avoid-column/*avoid-page*/;width:16rem}

比較

@import url('//gnjo.github.io/schoolmono.css');
.pair{list-style:none;font-family:schoolmono;font-size:14px;}
.pair>li{list-style:none;display:flex;flex-direction:row;line-height:1;
 justify-content:space-between;padding-top:6px;border-bottom:1px solid #ccc}
.pair>li:hover{border-color:#111}

.pair{columns:16rem}
.pair>li{break-inside: avoid-column/*avoid-page*/;width:16rem}
.pair.igavoid>li{break-inside:unset;}
<ul class="pair">
<li><div>KEY0</div><div>VALUE0</div></li>
<li><div>KEY1</div><div>VALUE1</div></li>
<li><div>KEY2</div><div>VALUE2</div></li>
<li><div>KEY3</div><div>VALUE3</div></li>
<li><div>KEY4</div><div>VALUE4</div></li>
<li><div>KEY5</div><div>VALUE5</div></li> 
<li><div>KEY6</div><div>VALUE6</div></li>
<li><div>KEY7</div><div>VALUE7</div></li>
<li><div>KEY8</div><div>VALUE8</div></li>
</ul>

<hr>

<ul class="pair igavoid">
<li><div>KEY0</div><div>VALUE0</div></li>
<li><div>KEY1</div><div>VALUE1</div></li>
<li><div>KEY2</div><div>VALUE2</div></li>
<li><div>KEY3</div><div>VALUE3</div></li>
<li><div>KEY4</div><div>VALUE4</div></li>
<li><div>KEY5</div><div>VALUE5</div></li> 
<li><div>KEY6</div><div>VALUE6</div></li>
<li><div>KEY7</div><div>VALUE7</div></li>
<li><div>KEY8</div><div>VALUE8</div></li> 
</ul>
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2