Vertically align smaller bullets with larger text

后端 未结 4 911
情歌与酒
情歌与酒 2021-02-05 08:06

I have a list with bullets. I made the bullets smaller by putting the li text inside a span and making the font-size of the li smaller tha

4条回答
  •  后悔当初
    2021-02-05 09:04

    This is what I used, it centers on both the bullet & the content

    Jsfiddle: http://jsfiddle.net/VR2hP/14/

    CSS:

    ul {
      padding-left: 5em;
      list-style: none;
    }
    
    li.twitter::before,
    li.fb::before {    
      font-family: 'FontAwesome';
      margin: 0 .2em 0 -1.5em;
      font-size: 3em;
      vertical-align: middle;
    }
    
    li.twitter::before {
      content: '\f081';
    }
    
    li.fb::before {
        content: '\f082';
    }
    
    li {
      list-style-type: none;
    }
    
    li span {
      display: inline-block;
      vertical-align: middle;
    }
    

提交回复
热议问题