Anybody knows, how to add bullets/separators between elements in horizontal list in Bootstrap 3?
<ul class="list-inline">
<li>Author: Michal</li>
<li>Modified: 17.08.2014</li>
<li>Comments: 5</li>
</ul>
Anybody knows, how to add bullets/separators between elements in horizontal list in Bootstrap 3?
<ul class="list-inline">
<li>Author: Michal</li>
<li>Modified: 17.08.2014</li>
<li>Comments: 5</li>
</ul>
Thy this CSS:
.list-inline{display:block;}
.list-inline li{display:inline-block;}
.list-inline li:after{content:'|'; margin:0 10px;}
you can see fiddle here.
Needless to say you can use anything you want instead of a pipe separator, this is just an example
You could use •
<ul class="list-inline">
<li>• Author: Michal</li>
<li>• Modified: 17.08.2014</li>
<li>• Comments: 5</li>
</ul>
Or you could use icons like Font Awesome, a bullet icon would be <i class="fa fa-circle"></i>
Here is an scss version for a variation on bootstrap 3's .list-inline
I've named .list-inline-separated
(using bullets):
.list-inline-separated {
@extend .list-inline;
li {
// adjust leading spacing for each additional item
margin-left: -10px;
&:first-child {
// no leading spacing for initial item
margin-left: 0px;
}
&:after {
content: '\2022'; // bullet
margin: 0 5px;
}
// no bullet on last
&:last-child:after {
content: '';
}
}
}
So far so good...
© 2022 - 2024 — McMap. All rights reserved.