{"id":1304,"date":"2025-04-21T00:35:07","date_gmt":"2025-04-21T00:35:07","guid":{"rendered":"https:\/\/satokotadesign.com\/blog\/?p=1304"},"modified":"2025-05-16T02:18:21","modified_gmt":"2025-05-16T02:18:21","slug":"css_calc","status":"publish","type":"post","link":"https:\/\/satokotadesign.com\/blog\/css_calc\/","title":{"rendered":"\u521d\u5fc3\u8005\u5fc5\u898b\uff01CSS\u306ecalc()\u95a2\u6570\u306e\u4f7f\u3044\u65b9\u3068\u5b9f\u8df5\u30c6\u30af\u30cb\u30c3\u30af5\u9078\u3010\u73fe\u5834\u3067\u4f7f\u3048\u308b\u3011"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff01\u9759\u5ca1\u770c\u6d5c\u677e\u5e02\u3067WEB\u30c7\u30b6\u30a4\u30ca\u30fc\u3092\u3057\u3066\u3044\u307e\u3059\u5c0f\u7027\u3067\u3059\u3002<br \/>\nWeb\u5236\u4f5c\u3092\u3057\u3066\u3044\u308b\u3068\u3001<span class=\"sc_marker-animation\">\u300c\u6570\u5024\u306e\u8db3\u3057\u7b97\u3084\u5f15\u304d\u7b97\u3092CSS\u3067\u3069\u3046\u3084\u3063\u3066\u8868\u73fe\u3059\u308b\u306e\uff1f\u300d<\/span>\u3068\u7591\u554f\u306b\u601d\u3046\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f<br \/>\n\u305d\u3093\u306a\u3068\u304d\u306b\u4fbf\u5229\u306a\u306e\u304c\u3001CSS\u306e calc() \u95a2\u6570\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u95a2\u6570\u3092\u3046\u307e\u304f\u4f7f\u3048\u3070\u3001\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u5bfe\u5fdc\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u8abf\u6574\u3084\u30c7\u30b6\u30a4\u30f3\u306e\u5fae\u8abf\u6574\u304c\u67d4\u8edf\u306b\u884c\u3048\u307e\u3059\u3002\u4eca\u56de\u306f\u3001\u521d\u5fc3\u8005\u306b\u3082\u5206\u304b\u308a\u3084\u3059\u304fcalc()\u306e\u57fa\u672c\u304b\u3089\u5b9f\u8df5\u7684\u306a\u4f7f\u3044\u65b9\u307e\u3067\u3092\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<hr class=\"diver-hr style-solid hr-content-text is-align-center\" style=\"color:#ccc;height:1px;background-image:linear-gradient(to right, #ccc, #ccc);\">\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">calc()\u95a2\u6570\u3063\u3066\u306a\u306b\uff1f<\/span><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-2025\u5e744\u670821\u65e5-09_38_16.png\" alt=\"\" width=\"1536\" height=\"1024\" class=\"alignnone size-full wp-image-1314\" srcset=\"https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-2025\u5e744\u670821\u65e5-09_38_16.png 1536w, https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-2025\u5e744\u670821\u65e5-09_38_16-500x333.png 500w, https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-2025\u5e744\u670821\u65e5-09_38_16-1024x683.png 1024w, https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2025\/04\/ChatGPT-Image-2025\u5e744\u670821\u65e5-09_38_16-768x512.png 768w\" sizes=\"auto, (max-width: 1536px) 100vw, 1536px\" \/><br \/>\ncalc() \u95a2\u6570\u306f\u3001CSS\u3067\u7570\u306a\u308b\u5358\u4f4d\u3092\u8a08\u7b97\u3059\u308b\u305f\u3081\u306e\u4fbf\u5229\u306a\u95a2\u6570\u3067\u3059\u3002<br \/>\n\u4f8b\u3048\u3070\u3001width: calc(100% - 40px); \u306e\u3088\u3046\u306b\u66f8\u304f\u3053\u3068\u3067\u3001\u5168\u4f53\u5e45\u304b\u3089\u7279\u5b9a\u306e\u30d4\u30af\u30bb\u30eb\u6570\u3092\u5f15\u3044\u305f\u5024\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"sc_frame_wrap inline blue\">\n<div class=\"sc_frame\"        >\n<div class=\"sc_designlist ul fa_check blue\">\n<ul>\n<li>\u30d1\u30fc\u30bb\u30f3\u30c8\u3068\u30d4\u30af\u30bb\u30eb\u306e\u6df7\u5408\u8a08\u7b97\u304c\u53ef\u80fd<\/li>\n<li>\u8db3\u3057\u7b97\uff08 + \uff09\u3001\u5f15\u304d\u7b97\uff08 - \uff09\u3001\u639b\u3051\u7b97\uff08 * \uff09\u3001\u5272\u308a\u7b97\uff08 \/ \uff09\u304c\u4f7f\u3048\u308b<\/li>\n<li>\u30b9\u30da\u30fc\u30b9\u3092\u5165\u308c\u308b\u3053\u3068\u304c\u5fc5\u8981\uff08\u4f8b\uff1a`calc(100% - 40px)`\uff09<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">1. \u76f8\u5bfe\u7684\u306a\u56fa\u5b9a\u8981\u7d20\u306e\u914d\u7f6e<\/span><\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u53f3\u30b5\u30a4\u30c9\u306b\u8868\u793a\u3057\u305f\u3044\u56fa\u5b9a\u30e1\u30cb\u30e5\u30fc\u3002<br \/>\n\u5de6\u306b\u30e1\u30a4\u30f3\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u3042\u308b\u5834\u5408\u3001calc() \u3092\u4f7f\u3063\u3066\u30b9\u30da\u30fc\u30b9\u5206\u3092\u5f15\u304f\u3053\u3068\u3067\u3001\u3061\u3087\u3046\u3069\u3088\u304f\u914d\u7f6e\u3067\u304d\u307e\u3059\u3002<\/p>\n<p class=\"codepen\" data-height=\"300\" data-default-tab=\"html,result\" data-slug-hash=\"ZYYQYgo\" data-pen-title=\"Untitled\" data-user=\"ekwwawpb-the-styleful\" style=\"height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;\">\n  <span>See the Pen <a href=\"https:\/\/codepen.io\/ekwwawpb-the-styleful\/pen\/ZYYQYgo\"><br \/>\n  Untitled<\/a> by \u5c0f\u7027\u8ce2 (<a href=\"https:\/\/codepen.io\/ekwwawpb-the-styleful\">@ekwwawpb-the-styleful<\/a>)<br \/>\n  on <a href=\"https:\/\/codepen.io\">CodePen<\/a>.<\/span>\n<\/p>\n<p><script async src=\"https:\/\/public.codepenassets.com\/embed\/index.js\"><\/script><\/p>\n<pre class=\"line-numbers\"><code class=\"language-css\"> .sidebar { position: fixed; right: calc(100% - 500px + 20px); } <\/code><\/pre>\n<p><span class=\"sc_marker-animation\">\u30dd\u30a4\u30f3\u30c8\uff1a<\/span> \u30ec\u30a4\u30a2\u30a6\u30c8\u5168\u4f53\u306e\u5e45\u304c\u5909\u308f\u3063\u3066\u3082\u3001\u5e38\u306b\u30d0\u30e9\u30f3\u30b9\u3088\u304f\u914d\u7f6e\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">2. \u5929\u5730\u5de6\u53f3\u306e\u4e2d\u592e\u306b\u914d\u7f6e<\/span><\/h2>\n<p>\u4e0a\u4e0b\u5de6\u53f3\u306e\u4e2d\u592e\u306b\u8981\u7d20\u3092\u914d\u7f6e\u3057\u305f\u3044\u3068\u304d\u306b\u3082 calc() \u306f\u4fbf\u5229\uff01<\/p>\n<p class=\"codepen\" data-height=\"300\" data-default-tab=\"html,result\" data-slug-hash=\"RNNrNON\" data-pen-title=\"Untitled\" data-user=\"ekwwawpb-the-styleful\" style=\"height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;\">\n  <span>See the Pen <a href=\"https:\/\/codepen.io\/ekwwawpb-the-styleful\/pen\/RNNrNON\"><br \/>\n  Untitled<\/a> by \u5c0f\u7027\u8ce2 (<a href=\"https:\/\/codepen.io\/ekwwawpb-the-styleful\">@ekwwawpb-the-styleful<\/a>)<br \/>\n  on <a href=\"https:\/\/codepen.io\">CodePen<\/a>.<\/span>\n<\/p>\n<p><script async src=\"https:\/\/public.codepenassets.com\/embed\/index.js\"><\/script><\/p>\n<pre class=\"line-numbers\"><code class=\"language-css\"> .center-box { position: absolute; top: calc(50% - 100px); left: calc(50% - 150px); width: 300px; height: 200px; } <\/code><\/pre>\n<p><span class=\"sc_marker-animation\">\u306a\u305c\u4f7f\u3046\u306e\u304b\uff1f<\/span><br \/>\ntransform\u3092\u4f7f\u3046\u65b9\u6cd5\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u8981\u7d20\u30b5\u30a4\u30ba\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u5834\u5408\u306f calc() \u306e\u65b9\u304c\u308f\u304b\u308a\u3084\u3059\u3044\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">3. \u76f8\u5bfe\u7684\u306a\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba\u306e\u8a2d\u5b9a<\/span><\/h2>\n<p>\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba\u3082 calc() \u3092\u4f7f\u3048\u3070\u3001\u30d9\u30fc\u30b9\u30b5\u30a4\u30ba\u306b\u5fdc\u3058\u3066\u67d4\u8edf\u306b\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u53ef\u80fd\u3002<\/p>\n<p class=\"codepen\" data-height=\"300\" data-default-tab=\"html,result\" data-slug-hash=\"azzdOzX\" data-pen-title=\"Untitled\" data-user=\"ekwwawpb-the-styleful\" style=\"height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;\">\n  <span>See the Pen <a href=\"https:\/\/codepen.io\/ekwwawpb-the-styleful\/pen\/azzdOzX\"><br \/>\n  Untitled<\/a> by \u5c0f\u7027\u8ce2 (<a href=\"https:\/\/codepen.io\/ekwwawpb-the-styleful\">@ekwwawpb-the-styleful<\/a>)<br \/>\n  on <a href=\"https:\/\/codepen.io\">CodePen<\/a>.<\/span>\n<\/p>\n<p><script async src=\"https:\/\/public.codepenassets.com\/embed\/index.js\"><\/script><\/p>\n<pre class=\"line-numbers\"><code class=\"language-css\"> h1 { font-size: calc(1rem + 0.5vw); } <\/code><\/pre>\n<p><span class=\"sc_marker-animation\">\u30dd\u30a4\u30f3\u30c8\uff1a<\/span>\u753b\u9762\u5e45\u306b\u5fdc\u3058\u3066\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba\u304c\u5fae\u8abf\u6574\u3055\u308c\u308b\u305f\u3081\u3001\u3088\u308a\u6d17\u7df4\u3055\u308c\u305f\u30c7\u30b6\u30a4\u30f3\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">4. \u80cc\u666f\u3092\u53f3\u4e0b\u306b\u914d\u7f6e<\/span><\/h2>\n<p>\u80cc\u666f\u753b\u50cf\u3092\u30b3\u30f3\u30c6\u30f3\u30c4\u306b\u304b\u3076\u3089\u306a\u3044\u3088\u3046\u306b\u53f3\u4e0b\u306b\u914d\u7f6e\u3057\u305f\u3044\u3068\u304d\u3082 calc() \u304c\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<p class=\"codepen\" data-height=\"300\" data-default-tab=\"html,result\" data-slug-hash=\"bNNEdpR\" data-pen-title=\"Untitled\" data-user=\"ekwwawpb-the-styleful\" style=\"height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;\">\n  <span>See the Pen <a href=\"https:\/\/codepen.io\/ekwwawpb-the-styleful\/pen\/bNNEdpR\"><br \/>\n  Untitled<\/a> by \u5c0f\u7027\u8ce2 (<a href=\"https:\/\/codepen.io\/ekwwawpb-the-styleful\">@ekwwawpb-the-styleful<\/a>)<br \/>\n  on <a href=\"https:\/\/codepen.io\">CodePen<\/a>.<\/span>\n<\/p>\n<p><script async src=\"https:\/\/public.codepenassets.com\/embed\/index.js\"><\/script><\/p>\n<pre class=\"line-numbers\"><code class=\"language-css\"> .hero { background-position: calc(100% - 40px) calc(100% - 40px); } <\/code><\/pre>\n<p><span class=\"sc_marker-animation\">\u306a\u305c\u4f7f\u3046\u306e\u304b\uff1f<\/span><br \/>\n\u753b\u9762\u306e\u30b5\u30a4\u30ba\u304c\u5909\u308f\u3063\u3066\u3082\u3001\u5e38\u306b\u4f59\u767d\u3092\u4fdd\u3063\u305f\u80cc\u666f\u914d\u7f6e\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">5. \u8981\u7d20\u306e\u6a2a\u5e45\u30923\u7b49\u5206\u306b\u3059\u308b<\/span><\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u30ab\u30fc\u30c9\u3092\u6a2a\u306b3\u3064\u4e26\u3079\u305f\u3044\u3068\u304d\u3002\u9593\u306e\u4f59\u767d\u3092\u5f15\u3044\u305f\u4e0a\u30673\u7b49\u5206\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p class=\"codepen\" data-height=\"300\" data-default-tab=\"html,result\" data-slug-hash=\"Wbbrvjd\" data-pen-title=\"Untitled\" data-user=\"ekwwawpb-the-styleful\" style=\"height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;\">\n  <span>See the Pen <a href=\"https:\/\/codepen.io\/ekwwawpb-the-styleful\/pen\/Wbbrvjd\"><br \/>\n  Untitled<\/a> by \u5c0f\u7027\u8ce2 (<a href=\"https:\/\/codepen.io\/ekwwawpb-the-styleful\">@ekwwawpb-the-styleful<\/a>)<br \/>\n  on <a href=\"https:\/\/codepen.io\">CodePen<\/a>.<\/span>\n<\/p>\n<p><script async src=\"https:\/\/public.codepenassets.com\/embed\/index.js\"><\/script><\/p>\n<pre class=\"line-numbers\"><code class=\"language-css\"> .card { width: calc((100% - 40px) \/ 3); margin-right: 20px; } <\/code><\/pre>\n<p>\u6700\u5f8c\u306e\u8981\u7d20\u3060\u3051 margin \u3092\u5916\u3059\u5de5\u592b\u3082\u5fc5\u8981\u3067\u3059\u306d\uff01<\/p>\n<h2 class=\"sc_heading solid blue\"><span class=\"sc_title\">\u307e\u3068\u3081<\/span><\/h2>\n<p>calc() \u95a2\u6570\u306f\u3001\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u30ec\u30a4\u30a2\u30a6\u30c8\u3084\u30d4\u30af\u30bb\u30eb\u5358\u4f4d\u306e\u5fae\u8abf\u6574\u306b\u6b20\u304b\u305b\u306a\u3044CSS\u30c6\u30af\u30cb\u30c3\u30af\u3067\u3059\u3002<br \/>\n\u521d\u5fc3\u8005\u306e\u3046\u3061\u306f\u300c\u3061\u3087\u3063\u3068\u96e3\u3057\u305d\u3046\u2026\u300d\u3068\u611f\u3058\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u5b9f\u969b\u306b\u4f7f\u3063\u3066\u307f\u308b\u3068\u9a5a\u304f\u307b\u3069\u4fbf\u5229\uff01<\/p>\n<p>\u307e\u305a\u306f\u4e0a\u8a18\u306e\u3088\u3046\u306a\u5177\u4f53\u7684\u306a\u5834\u9762\u3067 calc() \u3092\u53d6\u308a\u5165\u308c\u3066\u3001\u5c11\u3057\u305a\u3064\u6163\u308c\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><figure id=\"attachment_475\" aria-describedby=\"caption-attachment-475\" style=\"width: 1500px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/satokotadesign.com\/\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2022\/10\/bnr.jpg\" alt=\"\u9759\u5ca1\u770c\u6d5c\u677e\u5e02\u3067\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u5236\u4f5c\u306a\u3089satokotadesign\" width=\"1500\" height=\"500\" class=\"size-full wp-image-475\" srcset=\"https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2022\/10\/bnr.jpg 1500w, https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2022\/10\/bnr-500x167.jpg 500w, https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2022\/10\/bnr-1024x341.jpg 1024w, https:\/\/satokotadesign.com\/blog\/wp-content\/uploads\/2022\/10\/bnr-768x256.jpg 768w\" sizes=\"auto, (max-width: 1500px) 100vw, 1500px\" \/><\/a><figcaption id=\"caption-attachment-475\" class=\"wp-caption-text\"><a href=\"https:\/\/satokotadesign.com\/contact\/\" target=\"_blank\" rel=\"noopener\">\u9759\u5ca1\u770c\u6d5c\u677e\u5e02\u3067\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u5236\u4f5c\u306a\u3089satokotadesign<\/a><\/figcaption><\/figure><\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff01\u9759\u5ca1\u770c\u6d5c\u677e\u5e02\u3067WEB\u30c7\u30b6\u30a4\u30ca\u30fc\u3092\u3057\u3066\u3044\u307e\u3059\u5c0f\u7027\u3067\u3059\u3002 Web\u5236\u4f5c\u3092\u3057\u3066\u3044\u308b\u3068\u3001\u300c\u6570\u5024\u306e\u8db3\u3057\u7b97\u3084\u5f15\u304d\u7b97\u3092CSS\u3067\u3069\u3046\u3084\u3063\u3066\u8868\u73fe\u3059\u308b\u306e\uff1f\u300d\u3068\u7591\u554f\u306b\u601d\u3046\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f \u305d\u3093\u306a\u3068\u304d\u306b\u4fbf\u5229\u306a\u306e\u304c\u3001CSS\u306e calc() \u95a2\u6570\u3067\u3059\u3002 \u2026<\/p>\n","protected":false},"author":1,"featured_media":1311,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[7],"tags":[9],"class_list":["post-1304","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web","tag-css"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/posts\/1304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/comments?post=1304"}],"version-history":[{"count":7,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/posts\/1304\/revisions"}],"predecessor-version":[{"id":1315,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/posts\/1304\/revisions\/1315"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/media\/1311"}],"wp:attachment":[{"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/media?parent=1304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/categories?post=1304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/satokotadesign.com\/blog\/wp-json\/wp\/v2\/tags?post=1304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}