Add a space (“ ”) after an element using :after

后端 未结 5 2013
遥遥无期
遥遥无期 2020-12-12 09:41

I want to add a blank space after some content, however the content: \" \"; doesn\'t seem to work.

This is my code:

h2:after {
    conte         


        
5条回答
  •  臣服心动
    2020-12-12 10:29

    I needed this instead of using padding because I used inline-block containers to display a series of individual events in a workflow timeline. The last event in the timeline needed no arrow after it.

    Ended up with something like:

    .transaction-tile:after {
      content: "\f105";
    }
    
    .transaction-tile:last-child:after {
      content: "\00a0";
    }
    

    Used fontawesome for the gt (chevron) character. For whatever reason "content: none;" was producing alignment issues on the last tile.

提交回复
热议问题