{"id":5255,"date":"2026-04-30T11:27:17","date_gmt":"2026-04-30T02:27:17","guid":{"rendered":"https:\/\/dennie.tokyo\/it\/?p=5255"},"modified":"2026-04-30T12:32:49","modified_gmt":"2026-04-30T03:32:49","slug":"%e5%b1%9e%e6%80%a7%e3%82%bb%e3%83%ac%e3%82%af%e3%82%bf","status":"publish","type":"post","link":"https:\/\/dennie.tokyo\/it\/?p=5255","title":{"rendered":"\u5c5e\u6027\u30bb\u30ec\u30af\u30bf"},"content":{"rendered":"\n<p>css\u306f\u30af\u30e9\u30b9\u5c5e\u6027\u3001id\u5c5e\u6027\u3001\u30bf\u30b0\u306b\u5bfe\u3057\u3066\u30b9\u30bf\u30a4\u30eb\u3092\u6307\u5b9a\u3059\u308b\u4e8b\u304c\u591a\u3044\u3067\u3059\u304c\u3001\u305d\u306e\u4ed6\u306e\u5c5e\u6027\u306b\u5bfe\u3057\u3066\u3082\u30b9\u30bf\u30a4\u30eb\u3092\u6307\u5b9a\u3059\u308b\u4e8b\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h1 class=\"wp-block-heading\">\u5c5e\u6027\u30bb\u30ec\u30af\u30bf\u306e\u4f8b<\/h1>\n\n\n\n<p>\u30ab\u30b9\u30bf\u30e0\u30c7\u30fc\u30bf\u5c5e\u6027\u306b\u5bfe\u3057\u3066\u30b9\u30bf\u30a4\u30eb\u3092\u6307\u5b9a\u3059\u308b\u4e8b\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p><strong>HTML<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;div data-sample=&quot;false&quot;&gt;\u30b5\u30f3\u30d7\u30eb1&lt;\/div&gt;<\/code><\/pre><\/div>\n\n\n\n<p><strong>CSS<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>[data-sample] {\n  width: 50px;\n  height:50px;\n  background-color: aqua;\n}<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u7d50\u679c<\/strong><\/p>\n\n\n\n<style>\n[data-sample-00] {\n  width: 50px;\n  height:50px;\n  background-color: aqua;\n}\n<\/style>\n<div data-sample-00=\"false\">\u30b5\u30f3\u30d7\u30eb1<\/div>\n\n\n\n<h1 class=\"wp-block-heading\">\u57fa\u672c<\/h1>\n\n\n\n<p>\u5c5e\u6027\u30bb\u30ec\u30af\u30bf\u306b\u30b9\u30bf\u30a4\u30eb\u3092\u6307\u5b9a\u3059\u308b\u57fa\u672c\u7684\u306a\u65b9\u6cd5\u306f\u4e0b\u8a18\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>[\u5c5e\u6027\u540d] {\n  \u30b9\u30bf\u30a4\u30eb\n}<\/code><\/pre><\/div>\n\n\n\n<h1 class=\"wp-block-heading\">\u30d1\u30bf\u30fc\u30f3<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u5c5e\u6027\u540d<\/h2>\n\n\n\n<p>\u4f8b\u3067\u793a\u3057\u305f\u901a\u308a\u306a\u306e\u3067\u5272\u611b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5c5e\u6027\u540d=&#8221;\u5024&#8221;<\/h2>\n\n\n\n<p><strong>HTML<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;div data-sample=&quot;true&quot;&gt;\u30b5\u30f3\u30d7\u30eb2&lt;\/div&gt;<\/code><\/pre><\/div>\n\n\n\n<p><strong>CSS<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>[data-sample=&quot;true&quot;] {\n  width: 70px;\n  height:70px;\n  background-color: red;\n}<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u7d50\u679c<\/strong><\/p>\n\n\n\n<style>\n[data-sample-01=\"true\"] {\n  width: 70px;\n  height:70px;\n  background-color: red;\n}\n<\/style>\n<div data-sample-01=\"true\">\u30b5\u30f3\u30d7\u30eb2<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u5c5e\u6027\u540d~=\u201d\u5024\u201d<\/h2>\n\n\n\n<p>\u30c1\u30eb\u30c0(~)\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u305d\u306e\u5c5e\u6027\u304c\u7279\u5b9a\u306e\u5024\u3092\u542b\u3093\u3067\u3044\u308b\u8981\u7d20\u306b\u30b9\u30bf\u30a4\u30eb\u304c\u9069\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>HTML<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;div data-sample=&quot;a&quot;&gt;\u30b5\u30f3\u30d7\u30eb1&lt;\/div&gt;\n&lt;div data-sample=&quot;b&quot;&gt;\u30b5\u30f3\u30d7\u30eb2&lt;\/div&gt;\n&lt;div data-sample=&quot;a c&quot;&gt;\u30b5\u30f3\u30d7\u30eb3&lt;\/div&gt;<\/code><\/pre><\/div>\n\n\n\n<p><strong>CSS<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>[data-sample] {\n  width: 50px;\n  height:50px;\n  background-color: aqua;\n}\n\n[data-sample~=&quot;a&quot;] {\n  width: 70px;\n  height:70px;\n  background-color: red;\n}<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u7d50\u679c<\/strong><\/p>\n\n\n\n<p>data-sample\u5c5e\u6027\u306b &#8220;a&#8221; \u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u304c\u8d64\u304f\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<style>\n[data-sample-02] {\n  width: 50px;\n  height:50px;\n  background-color: aqua;\n}\n\n[data-sample-02~=\"a\"] {\n  width: 70px;\n  height:70px;\n  background-color: red;\n}\n<\/style>\n<div data-sample-02=\"a\">\u30b5\u30f3\u30d7\u30eb1<\/div>\n<div data-sample-02=\"b\">\u30b5\u30f3\u30d7\u30eb2<\/div>\n<div data-sample-02=\"a c\">\u30b5\u30f3\u30d7\u30eb3<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u5c5e\u6027\u540d*=\u201d\u5024\u201d<\/h2>\n\n\n\n<p>\u305d\u306e\u5c5e\u6027\u304c\u7279\u5b9a\u306e\u5024\u306e\u6587\u5b57\u5217\u3092\u542b\u3093\u3067\u3044\u308b\u8981\u7d20\u306b\u30b9\u30bf\u30a4\u30eb\u304c\u9069\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>HTML<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;div data-sample=&quot;test01&quot;&gt;\u30b5\u30f3\u30d7\u30eb1&lt;\/div&gt;\n&lt;div data-sample=&quot;01test&quot;&gt;\u30b5\u30f3\u30d7\u30eb2&lt;\/div&gt;\n&lt;div data-sample=&quot;main&quot;&gt;\u30b5\u30f3\u30d7\u30eb3&lt;\/div&gt;<\/code><\/pre><\/div>\n\n\n\n<p><strong>CSS<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>[data-sample] {\n  width: 50px;\n  height:50px;\n  background-color: aqua;\n}\n\n[data-sample*=&quot;test&quot;] {\n  width: 70px;\n  height:70px;\n  background-color: red;\n}<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u7d50\u679c<\/strong><\/p>\n\n\n\n<style>\n[data-sample-03] {\n  width: 50px;\n  height:50px;\n  background-color: aqua;\n}\n\n[data-sample-03*=\"test\"] {\n  width: 70px;\n  height:70px;\n  background-color: red;\n}\n<\/style>\n<div data-sample-03=\"test01\">\u30b5\u30f3\u30d7\u30eb1<\/div>\n<div data-sample-03=\"01test\">\u30b5\u30f3\u30d7\u30eb2<\/div>\n<div data-sample-03=\"main\">\u30b5\u30f3\u30d7\u30eb3<\/div>\n\n\n\n<h1 class=\"wp-block-heading\">\u6ce8\u610f\u70b9<\/h1>\n\n\n\n<p>\u5f53\u7136\u3067\u3059\u304c\u3001\u300c\u5c5e\u6027\u540d=&#8221;\u5024&#8221;\u300d\u3088\u308a\u3082\u300c\u5c5e\u6027\u540d\u300d\u3067\u30b9\u30bf\u30a4\u30eb\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u5f8c\u306b\u6307\u5b9a\u3057\u305f\u65b9\u306b\u30b9\u30bf\u30a4\u30eb\u304c\u4e0a\u66f8\u304d\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong>HTML<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;div data-sample=&quot;false&quot;&gt;\u30b5\u30f3\u30d7\u30eb1&lt;\/div&gt;\n&lt;div data-sample=&quot;true&quot;&gt;\u30b5\u30f3\u30d7\u30eb2&lt;\/div&gt;<\/code><\/pre><\/div>\n\n\n\n<p><strong>CSS<\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>[data-sample=&quot;true&quot;] {\n  width: 70px;\n  height:70px;\n  background-color: red;\n}\n\n[data-sample] {\n  width: 50px;\n  height:50px;\n  background-color: aqua;\n}<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u7d50\u679c<\/strong><\/p>\n\n\n\n<style>\n[data-sample-11=\"true\"] {\n  width: 70px;\n  height:70px;\n  background-color: red;\n}\n\n[data-sample-11] {\n  width: 50px;\n  height:50px;\n  background-color: aqua;\n}\n<\/style>\n<div data-sample-11=\"false\">\u30b5\u30f3\u30d7\u30eb1<\/div>\n<div data-sample-11=\"true\">\u30b5\u30f3\u30d7\u30eb2<\/div>\n\n\n\n\n<h1 class=\"wp-block-heading\">\u6700\u5f8c\u306b<\/h1>\n\n\n\n<p>\u7279\u306b\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>css\u306f\u30af\u30e9\u30b9\u5c5e\u6027\u3001id\u5c5e\u6027\u3001\u30bf\u30b0\u306b\u5bfe\u3057\u3066\u30b9\u30bf\u30a4\u30eb\u3092\u6307\u5b9a\u3059\u308b\u4e8b\u304c\u591a\u3044\u3067\u3059\u304c\u3001\u305d\u306e\u4ed6\u306e\u5c5e\u6027\u306b\u5bfe\u3057\u3066\u3082\u30b9\u30bf\u30a4\u30eb\u3092\u6307\u5b9a\u3059\u308b\u4e8b\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":4723,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-5255","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css"],"_links":{"self":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/5255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5255"}],"version-history":[{"count":6,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/5255\/revisions"}],"predecessor-version":[{"id":5262,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/5255\/revisions\/5262"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/media\/4723"}],"wp:attachment":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}