Architect's Log

I'm a Cloud Architect. I'm highly motivated to reduce toils with driving DevOps.

CSS 単純な属性セレクタ

単純な属性セレクタは、指定された属性をもつ要素にスタイルを適用します。

使用例

<!DOCTYPE html>
<html lang="ja">
<head>
<title>Hello! CSS</title>
<meta charset="UTF-8">
<style>
[class] {   /* class属性をもつ要素 */
    color:  red;
}
</style>
</head>
<body>
<p class="notification">第1段落です。</p>
<p class="infomation">第2段落です。</p>
<p>第3段落です。</p>
</body>
</html>

レンダリング(Chrome)

関連エントリー

CSSエントリーのまとめ - プログラマーな日々
CSSに関するエントリーのまとめページです。 ...