1

I want to reduce how thick the list-group-item are, whilst keeping the title text fitting.

<ul class="list-group"> 
  <a href="#id" class="list-group-item list-group-item-info" data-toggle="collapse">Title</a>
</ul>

.list-group-item {
  height: 10px;
}

This successfully reduces the thickness, but the Title text remains too big. I suspect height is the wrong property to use?

text too big

Community
  • 1
  • 1
user3722194
  • 203
  • 1
  • 6
  • 13

3 Answers3

2

The size is controlled by this class

.list-group-item {
    position: relative;
    display: block;
    padding: 0px 15px; /* adjust here */
    margin-bottom: -1px;
    border: 1px solid #ddd;
    line-height: 1em /* set to text height */
}

Codepen Demo

Paulie_D
  • 107,962
  • 13
  • 142
  • 161
1

li tags have a default padding. You must to reset it to achieve it. The text have a line-height defined relative to his size. You must to define the line-height as equal as height.

  li {
    padding:0;
    height: 10px;
    line-height: 10px;
  }
Marcos Pérez Gude
  • 21,869
  • 4
  • 38
  • 69
0

don't do that instead use padding like this..

ul a {
padding:10px; // give padding
height:auto;
}
MarmiK
  • 5,639
  • 6
  • 40
  • 49
Sachin Kanungo
  • 1,054
  • 9
  • 17