{"id":4818,"date":"2026-01-13T19:31:26","date_gmt":"2026-01-13T10:31:26","guid":{"rendered":"https:\/\/dennie.tokyo\/it\/?p=4818"},"modified":"2026-01-14T08:46:53","modified_gmt":"2026-01-13T23:46:53","slug":"%e3%80%90css%e3%80%91%e6%96%87%e5%ad%97%e3%82%b5%e3%82%a4%e3%82%ba%e3%81%ae%e5%8d%98%e4%bd%8d%e6%8c%87%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/dennie.tokyo\/it\/?p=4818","title":{"rendered":"\u3010CSS\u3011\u6587\u5b57\u30b5\u30a4\u30ba\u306e\u5358\u4f4d\u6307\u5b9a"},"content":{"rendered":"\n<p>\u6587\u5b57\u30b5\u30a4\u30ba\u306f\u8272\u3005\u306a\u5358\u4f4d\u3067\u6307\u5b9a\u3059\u308b\u4e8b\u304c\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u4eca\u56de\u306f\u6587\u5b57\u30b5\u30a4\u30ba\u306e\u5358\u4f4d\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">px(\u30d4\u30af\u30bb\u30eb)<\/h1>\n\n\n\n<p>\u30d4\u30af\u30bb\u30eb\u306f\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u306e\u89e3\u50cf\u5ea6\u306b\u5bfe\u3059\u308b\u7d76\u5bfe\u5024\u306b\u306a\u308a\u307e\u3059\u3002\u5f93\u3063\u3066\u3001\u89e3\u50cf\u5ea6\u306b\u3088\u3063\u3066\u6587\u5b57\u30b5\u30a4\u30ba\u304c\u5909\u308f\u308a\u307e\u3059\u3002\u9ad8\u89e3\u50cf\u5ea6\u30c7\u30a3\u30b9\u30d7\u30ec\u30a4\u306e\u5834\u5408\u3001\u6587\u5b57\u304c\u5c0f\u3055\u304f\u898b\u3048\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">%(\u30d1\u30fc\u30bb\u30f3\u30c8)<\/h1>\n\n\n\n<p>\u89aa\u8981\u7d20\u306e\u6587\u5b57\u30b5\u30a4\u30ba\u306b\u5bfe\u3057\u3066\u306e\u5272\u5408\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f8b<\/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 class=&quot;root&quot;&gt;\n  &lt;div class=&quot;main&quot;&gt;\n    &lt;div class=&quot;title&quot;&gt;\u30bf\u30a4\u30c8\u30eb1&lt;\/div&gt;\n    &lt;div class=&quot;contents&quot;&gt;\u6587\u7ae0\u3092\u66f8\u304d\u307e\u3059\u3002\u3042\u3042\u3042\u3042\u3042\u3002&lt;\/div&gt;\n  &lt;\/div&gt;\n&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>.root {\n  font-size: 24px;\n}\n.main {\n  font-size: 32px;\n}\n.box {\n  font-size: 100%;\n}\n.contents {\n  font-size: 50%;\n}<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u7d50\u679c<\/strong><\/p>\n\n\n\n<p>.main \u30af\u30e9\u30b9\u306efont-size\u306e\u5272\u5408\u306b\u306a\u308b\u306e\u3067\u3001100%=32px\u3068\u306a\u308a\u307e\u3059\u3002\u5f93\u3063\u3066\u3001\u30bf\u30a4\u30c8\u30eb\u304c32px\u3001\u30b3\u30f3\u30c6\u30f3\u30c4\u6587\u7ae0\u304c16px\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<style>\n.root_test {\n  font-size: 24px;\n}\n.main_test {\n  font-size: 32px;\n}\n.box_test {\n  font-size: 100%;\n}\n.contents_test {\n  font-size: 50%;\n}\n<\/style>\n<div class=\"root_test\">\n  <div class=\"main_test\">\n    <div class=\"title_test\">\u30bf\u30a4\u30c8\u30eb1<\/div>\n    <div class=\"contents_test\">\u6587\u7ae0\u3092\u66f8\u304d\u307e\u3059\u3002\u3042\u3042\u3042\u3042\u3042\u3002<\/div>\n  <\/div>\n<\/div>\n\n\n\n<h1 class=\"wp-block-heading\">EM(\u30a8\u30e0)<\/h1>\n\n\n\n<p>em \u306f\u89aa\u8981\u7d20\u306e\u6587\u5b57\u30b5\u30a4\u30ba\u3092\u57fa\u6e96\u306b\u3057\u305f\u30b5\u30a4\u30ba\u6307\u5b9a\u306b\u306a\u308a\u307e\u3059\u3002\u89aa\u8981\u7d20\u306e\u30b5\u30a4\u30ba = 1em \u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f8b<\/h2>\n\n\n\n<p>HTML\u306f\u524d\u56de\u306e\u4f8b\u3068\u540c\u3058\u306a\u306e\u3067\u5272\u611b\u3057\u307e\u3059\u3002<\/p>\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>.root {\n  font-size: 24px;\n}\n.main {\n  font-size: 32px;\n}\n.box {\n  font-size: 1em;\n}\n.contents {\n  font-size: 0.5em;\n}<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u7d50\u679c<\/strong><\/p>\n\n\n\n<p>.main \u30af\u30e9\u30b9\u306e font-size \u304c\u57fa\u6e96\u3068\u306a\u308b\u306e\u3067 <strong>1em = 32px<\/strong> \u3068\u306a\u308a\u307e\u3059\u3002\u5f93\u3063\u3066\u3001\u30bf\u30a4\u30c8\u30eb\u304c 32px\u3001\u30b3\u30f3\u30c6\u30f3\u30c4\u6587\u7ae0\u304c 16px \u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<style>\n.root_test_em {\n  font-size: 24px;\n}\n.main_test_em {\n  font-size: 32px;\n}\n.box_test_em {\n  font-size: 1em;\n}\n.contents_test_em {\n  font-size: 0.5em;\n}\n<\/style>\n<div class=\"root_test_em\">\n  <div class=\"main_test_em\">\n    <div class=\"title_test_em\">\u30bf\u30a4\u30c8\u30eb1<\/div>\n    <div class=\"contents_test_em\">\u6587\u7ae0\u3092\u66f8\u304d\u307e\u3059\u3002\u3042\u3042\u3042\u3042\u3042\u3002<\/div>\n  <\/div>\n<\/div>\n\n\n\n<h1 class=\"wp-block-heading\">REM(\u30ec\u30e0)<\/h1>\n\n\n\n<p>rem \u306f\u30eb\u30fc\u30c8\u8981\u7d20(\u6700\u4e0a\u4f4d\u306e\u8981\u7d20)\u306e\u6587\u5b57\u30b5\u30a4\u30ba\u3092\u57fa\u6e96\u306b\u3057\u305f\u30b5\u30a4\u30ba\u6307\u5b9a\u306b\u306a\u308a\u307e\u3059\u3002\u30eb\u30fc\u30c8\u8981\u7d20\u306e\u30b5\u30a4\u30ba = 1rem \u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f8b<\/h2>\n\n\n\n<p>HTML\u306f\u524d\u56de\u306e\u4f8b\u3068\u540c\u3058\u306a\u306e\u3067\u5272\u611b\u3057\u307e\u3059\u3002<\/p>\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>.root {\n  font-size: 24px;\n}\n.main {\n  font-size: 32px;\n}\n.box {\n  font-size: 1rem;\n}\n.contents {\n  font-size: 0.5rem;\n}<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u7d50\u679c<\/strong><\/p>\n\n\n\n<p>.root \u30af\u30e9\u30b9\u306e font-size \u304c\u57fa\u6e96\u3068\u306a\u308b\u306e\u3067 <strong>1rem = 24px<\/strong> \u3068\u306a\u308a\u307e\u3059\u3002\u5f93\u3063\u3066\u3001\u30bf\u30a4\u30c8\u30eb\u304c 24px\u3001\u30b3\u30f3\u30c6\u30f3\u30c4\u6587\u7ae0\u304c 12px \u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<style>\n.root_test_rem {\n  font-size: 24px;\n}\n.main_test_rem {\n  font-size: 32px;\n}\n.box_test_rem {\n  font-size: 1rem;\n}\n.contents_test_rem {\n  font-size: 0.5rem;\n}\n<\/style>\n<div class=\"root_test_rem\">\n  <div class=\"main_test_rem\">\n    <div class=\"title_test_rem\">\u30bf\u30a4\u30c8\u30eb1<\/div>\n    <div class=\"contents_test_rem\">\u6587\u7ae0\u3092\u66f8\u304d\u307e\u3059\u3002\u3042\u3042\u3042\u3042\u3042\u3002<\/div>\n  <\/div>\n<\/div>\n\n\n\n<h1 class=\"wp-block-heading\">font-size\u3092\u6307\u5b9a\u3057\u306a\u3044\u5834\u5408<\/h1>\n\n\n\n<p>font-size\u3092\u6307\u5b9a\u3057\u306a\u3044\u5834\u5408\u3001\u6587\u5b57\u30b5\u30a4\u30ba\u306f16px\u3068\u306a\u308a\u307e\u3059\u3002\u30b5\u30a4\u30ba\u3092\u76f8\u5bfe\u7684\u306b\u6307\u5b9a\u3059\u308b\u5834\u5408\u300116px\u304c\u57fa\u6e96\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\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>\u6587\u5b57\u30b5\u30a4\u30ba\u306f\u8272\u3005\u306a\u5358\u4f4d\u3067\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-4818","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\/4818","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=4818"}],"version-history":[{"count":14,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/4818\/revisions"}],"predecessor-version":[{"id":4839,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/4818\/revisions\/4839"}],"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=4818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}