content

書式 content:表示内容
対象after、before疑似要素
継承しない
初期値 なし
解説
先頭および末尾に指定した文字列や画像などを追加します。以下のものが指定できます。
設定値形状
"〜"文字列
url(〜)指定したURIの画像
attr(〜)指定した属性
open-quotequotesプロパティで指定した文字列
close-quotequotesプロパティで指定した文字列
no-open-quotequotesプロパティで指定した文字列の階層を次の階層に下げる
no-close-quotequotesプロパティで指定した文字列の階層を次の階層に上げる
サンプルコード
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<style type="text/css"><!--
body { margin:0px; }
div { position:absolute; left:10px; top:10px;width:300px;height:100px;
border:1px black solid;
}
div:before { content:"Dashboard : " }
--></style>
</head>
<body>
<img src="Default.png">
<div>Sample Text</div>
</body>
</html>
実際のサンプルをダウンロード