文字的背景颜色(仅) [英] Background color for text (only)

查看:88
本文介绍了文字的背景颜色(仅)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以实现这一目标:

I am wondering if it's posible to achieve this:

我的意思是,仅将背景颜色应用于文本,而不是整个块,

I mean, applying the background color just to the text instead of the whole block,

ej

<h1>WELLCOME TO RENTAL IN MALLORCA BEATYFULL COLLECTION OF APPARTMENTS</h1>

是否有(可能的话)跨浏览器的方法?

Is there a (cross browser, if possible) way to do this?

推荐答案

是.在<h1>内添加<span>,并为其应用背景色和行高.

Yes. Add a <span> inside the <h1>, and apply the background colour and a line-height to it.

演示

这篇关于文字的背景颜色(仅)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆