如何使带引号的文本合理化?
how to make text with quotations justify?
我想用引号证明文本如下:
‘‘ text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text ”
注意上面引文的所有行都在同一水平对齐,引文的颜色和大小也应该与文本不同,
那么我如何使用 html & css 来做到这一点?
如果您希望引号的样式与文本的其余部分不同,最好的办法是单独标记它们。更好的是,如果您改为使用 ::before
和 ::after
执行此操作,并将文本包含在 blockquote
.
中
如果您对生成的内容执行此操作,并且不浮动或定位 ::before
和 ::after
伪元素,则使用负数 text-indent
通过从文本的其余部分偏移开引号所需的数量,并添加左填充以补偿缩进。
如何在 HTML 和 CSS 中实现这一点完全取决于您当前拥有的东西,但是您只需一个简单的 blockquote
和 blockquote
中完成的所有其他操作即可轻松完成此操作=23=].
你可以用 before 和 after 伪元素做这样的事情。
<blockquote>
You know the golden rule, don’t you boy? Those who have the gold make the rules.
You know the golden rule, don’t you boy? Those who have the gold make the rules.
</blockquote>
blockquote {
text-align:justify;
padding:10px;
}
blockquote:before {
position:absolute;
margin-left:-10px;
content: open-quote;
quotes: "1C" "1D" "18" "19";
}
blockquote:after {
position:absolute;
content: close-quote;
quotes: "1C" "1D" "18" "19";
}
我想用引号证明文本如下:
‘‘ text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text ”
注意上面引文的所有行都在同一水平对齐,引文的颜色和大小也应该与文本不同, 那么我如何使用 html & css 来做到这一点?
如果您希望引号的样式与文本的其余部分不同,最好的办法是单独标记它们。更好的是,如果您改为使用 ::before
和 ::after
执行此操作,并将文本包含在 blockquote
.
如果您对生成的内容执行此操作,并且不浮动或定位 ::before
和 ::after
伪元素,则使用负数 text-indent
通过从文本的其余部分偏移开引号所需的数量,并添加左填充以补偿缩进。
如何在 HTML 和 CSS 中实现这一点完全取决于您当前拥有的东西,但是您只需一个简单的 blockquote
和 blockquote
中完成的所有其他操作即可轻松完成此操作=23=].
你可以用 before 和 after 伪元素做这样的事情。
<blockquote>
You know the golden rule, don’t you boy? Those who have the gold make the rules.
You know the golden rule, don’t you boy? Those who have the gold make the rules.
</blockquote>
blockquote {
text-align:justify;
padding:10px;
}
blockquote:before {
position:absolute;
margin-left:-10px;
content: open-quote;
quotes: "1C" "1D" "18" "19";
}
blockquote:after {
position:absolute;
content: close-quote;
quotes: "1C" "1D" "18" "19";
}