Padding for two-lined headline

前端 未结 5 1575
陌清茗
陌清茗 2021-01-24 09:22

That is a little bit hard to explain, if someone knows a better title for this, please go ahead and change it.

I want to draw a black box behind my headline. I\'m doing

5条回答
  •  礼貌的吻别
    2021-01-24 09:50

    you should set padding on h1 and/or set span as inline-block http://jsfiddle.net/832u8/9/ ( span inline-block)

     h1 span {
            background: none repeat scroll 0 0 #000000;
            line-height:44px;
            padding:7px 25px 8px 25px;
            display:inline-block;
        }
    

    http://jsfiddle.net/832u8/3/ (padding h1)

    .headline-black h1 {
        color: #FFFFFF;
        font-size: 22px;
    padding:0 1em;
    }
    

提交回复
热议问题