Padding for two-lined headline

前端 未结 5 1679
陌清茗
陌清茗 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:38

    I'm assuming you WANT it to split to "two dark lines" in that fashion? Because if you just want a black background to your titles, that DOES retain the padding, then this simplified version will work:

    Some very, very long headline, that is very, very long.

    h1 { background: #000; line-height:33px; padding: 8px 25px; color: #fff }

    Updated Fiddle: http://jsfiddle.net/kWgD2/

提交回复
热议问题