備忘録的プログラミングリファレンス

quotes プロパティ

 quotes プロパティは、<q> エレメントの引用符を定義するプロパティです。

 設定されたエレメント内の <q> エレメントに反映されます。

 引用符""、''、「」などを設定することができます。擬似エレメント ::before::aftercontent プロパティを合わせて使います。

 引用符は入れ子にするこtができ、2つ目まで定義できます。

引用符"「"、"」"の定義
p{
	quotes: "「" "」";
}
q::before{
	content: open-quote;
}
q::after{
	content: close-quote;
}

詳しくは Example を参照してください

ページ内 Index

構文(Syntax)

CSS

quotes: none | [ string string ] | initial | inherit;

DOM ( JavaScript )

値の取得
String = object.style.quotes;
値の設定
object.style.quotes="none | [ string string ] | initial | inherit";

値(Values)

 引用符は入れ子が2つ目まで定義できます。2つ目まで定義するには、string string string stringと任意の文字を4つ並べます。 1番目と2番目が第1引用符のopen-quoteとclose-quote、3番目と4番目が入れ子になる引用符のopen-quoteとclose-quoteになります。

Value摘要
none初期値(default値)
string string任意の文字列、第1引数がopen-quote、第二引数がclose-quote
initial初期値に戻す
inherit親エレメントのプロパティを継承

備考(Remarks)

初期値(Default value) 
継承(Inherited)Yes
CSS AnimationNo

Example

quotesの例です。エレメントにquotes プロパティを指定すると<q>で引用符が付加されます。

 ここでは引用符は付加されたところが分かりやすいように<q>エレメントを太字で表示していています。