Html CSS 3:在块引用的开头添加引号
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4597699/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
CSS 3: Adding quote symbol to beginning of blockquote
提问by AgileMeansDoAsLittleAsPossible
Can anyone tell me why this (also available live at http://jsfiddle.net/A2eTG/6/) renders a "
symbol before the blockquote in Firefox but not Chrome/Safari?
谁能告诉我为什么这(也可以在http://jsfiddle.net/A2eTG/6/ 上实时获得)"
在 Firefox 中的块引用之前呈现一个符号,而不是 Chrome/Safari?
blockquote
{
padding: 0 60px;
padding:10px;
padding-left:55px;
}
blockquote:before {
display: block;
font-size: 700%;
content: open-quote;
height: 1px;
margin-left: -0.55em;
position:relative;
top:-20px;
}
The blockquote:before
selector shows up in Chrome's developer tools but doesn't appear on screen.
在blockquote:before
选择显示了在Chrome的开发者工具,但不会出现在屏幕上。
What gives?
是什么赋予了?
采纳答案by Brian Flanagan
Looks like Chrome doesn't support content: open-quote
. Try this instead:
看起来 Chrome 不支持content: open-quote
. 试试这个:
content: "\"";
回答by etcet
To help others who came across this and want prettier quotes than "
, these are the codes for double open, double closed, single open, and single closed quotation marks respectively: "\201C"
, "\201D"
, "\2018"
, "\2019"
.
为了帮助遇到此问题并想要比 更漂亮的引号的其他人"
,这些是双开、双闭、单开和单闭引号的代码:"\201C"
, "\201D"
, "\2018"
, "\2019"
。
回答by Sotiris
Chrome supports content
partially, and open-quote
is not supported.
Chromecontent
部分支持,open-quote
不支持。
So what you can try is to use content: '“';
The shortcut to print the open-quote
in Windows is Alt+0147
and if there is need for close-quote
also then Alt+0148
.
因此,您可以尝试使用在 Windows 中content: '“';
打印的快捷方式open-quote
是Alt+0147
,如果需要,close-quote
则Alt+0148
.
回答by weston
See Rendering Quotes With CSSfor more detail on this issue as well as how to localize the quotes for different languages.
有关此问题的更多详细信息以及如何本地化不同语言的引号,请参阅使用 CSS 渲染引号。
回答by Domenic
I think the best solution would be
我认为最好的解决方案是
content: '“';
content: open-quote;
That way browsers that support open-quote
would use it and ignore the earlier content
value, while browsers that don't know what open-quote
is will ignore that line and use the first one.
这样,支持的浏览器open-quote
将使用它并忽略较早的content
值,而不知道是什么的浏览器open-quote
将忽略该行并使用第一个。