CSS width of a tag

后端 未结 7 633
清歌不尽
清歌不尽 2020-12-07 16:36

I use tags in my module titles, e.g.

Categories.

I specify the span\'s background color/imag

7条回答
  •  独厮守ぢ
    2020-12-07 16:48

    You can't specify the width of an element with display inline. You could put something in it like a non-breaking space ( ) and then set the padding to give it some more width but you can't control it directly.

    You could use display inline-block but that isn't widely supported.

    A real hack would be to put an image inside and then set the width of that. Something like a transparent 1 pixel GIF. Not the recommended approach however.

提交回复
热议问题