gpt4 book ai didi

html - block 引用背景颜色跟随行长度

转载 作者:太空宇宙 更新时间:2023-11-04 08:43:54 26 4
gpt4 key购买 nike

您好,可以使 block 引用的背景跟随文本行的长度。这是我的 block 引用的以下代码

<blockquote>
<p>£265,000 will make an XXL difference</p>
</blockquote>

我当前的 CSS:

blockquote p {
padding: 10px!important;
text-align: right!important;
font-size: 33px!important;
color: #fff!important;
font-weight: 600!important;
font-family: $heading-fancy!important;
}
blockquote {
background-color: #183052!important;
float: right!important;
width: auto!important;
max-width: 250px!important;
margin: 10px 0!important;
}

这是目前的样子。 https://jsfiddle.net/2atm3ktn/

有没有可能用背景颜色实现这种外观...... https://s7.postimg.org/m29mkdwhn/example.png

我之前通过添加额外的容器 (div) 和使用边框在标题上实现了这种效果。理想情况下, block 引用周围不再有标签,因为用户只需在所见即所得中单击 block 引用即可。

欢迎提出想法。

最佳答案

你可以做这样的事情,希望对你有帮助。

blockquote p {
padding: 10px!important;
text-align: right!important;
font-size: 33px!important;
color: #fff!important;
font-weight: 600!important;
font-family: $heading-fancy!important;
margin: 0;

}
blockquote {
background-color: #183052!important;
float: right!important;
width: auto!important;
max-width: 250px!important;
margin: 10px 0!important;
padding: 0;
}
span{ background-color: green;}
<blockquote>
<p>
<span>£265,000 will make an XXL difference</span>
</p>
</blockquote>

关于html - block 引用背景颜色跟随行长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43915789/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com