html - break list item in two columns on small screen in bootstrap -
i want break list items 2 columns on small screen must in 1 column on md screen
<div> <ul> <li> list item 1 </li> <li> list item 2 </li> <li> list item 3 </li> <li> list item 4 </li> </ul> </div>
i want break list item item 3 , item 4 must displayed in second column in front of item 1 on small screen
output should
- list item 1 list item-4
- list item 2
- list item 3
try below code
.clear-left { clear: left } .clear-right { clear: right } ul { padding: 0 !important; margin: 0 !important; } li { padding: 10px; border: 1px solid #aaa; background: rgba(0, 0, 0, 0.07); list-style-type: none; } .block-1 { background: rgba(0, 0, 0, 0.05); } .block-2 { margin-top: 20px; background: rgba(0, 0, 0, 0.05); }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" /> <div class="container block-1"> <ul> <li class="col-sm-12 col-md-6 clear-left">list item 1</li> <li class="col-sm-12 col-md-6 clear-left">list item 2</li> <li class="col-sm-12 col-md-6 clear-left">list item 3</li> <li class="col-sm-12 col-md-6 clear-right">list item 4</li> </ul> </div> <div class="container block-2"> <ul class="col-sm-12 col-md-6"> <li>list item 1</li> <li>list item 2</li> <li>list item 3</li> </ul> <ul class="col-sm-12 col-md-6"> <li>list item 4</li> </ul> </div>
Comments
Post a Comment