In IE11 using pseudo element ::before and display:table-cell and glyphicons contens wont show up

后端 未结 2 1185
有刺的猬
有刺的猬 2020-12-21 04:04

I\'ve spent a rather good time on this now but cant come to a solution. My problem is that I want to display a glyphicon before the content of a text-block and that element

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-21 04:26

    Adding float:left to .body does the trick

    .body:before {
        background: blue;
        content: "\e005";
        font-family: "Glyphicons Halflings";
        display: table-cell;
        width:30%;
        float:left;
    }
    

    fiddle


    I will keep this previous answer here. Users may find it useful:

    You can try using content: "\2665" instead of "/e005"

    .body:before {
        background: blue;
        content: "\2665";
        display: table-cell;
        width:30%;
    }
    

    fiddle

    Click here for more info.

提交回复
热议问题