{"id":1269,"date":"2019-04-02T01:11:27","date_gmt":"2019-04-01T16:11:27","guid":{"rendered":"https:\/\/hi3103.net\/notes\/?p=1269"},"modified":"2022-07-09T23:34:09","modified_gmt":"2022-07-09T14:34:09","slug":"css-%e3%81%ae-before-%e3%81%a8-after-%e3%81%ae%e7%96%91%e4%bc%bc%e8%a6%81%e7%b4%a0%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%83%aa%e3%83%9c%e3%83%b3%e9%a2%a8%e8%a6%8b%e5%87%ba%e3%81%97%e3%82%92","status":"publish","type":"post","link":"https:\/\/hi3103.net\/notes\/web\/1269","title":{"rendered":":before \u3068 :after \u306e\u7591\u4f3c\u8981\u7d20\u3092\u4f7f\u3063\u3066CSS\u3067\u30ea\u30dc\u30f3\u98a8\u898b\u51fa\u3057\u3092\u4f5c\u308b\u65b9\u6cd5"},"content":{"rendered":"<h3>\u3056\u3063\u304f\u308a\u3057\u305f\u89e3\u8aac<\/h3>\n<p>\u4eca\u56de\u306f h1 \u8981\u7d20\u3092\u88c5\u98fe\u3059\u308b\u3002\u5de6\u53f3\u306b\u914d\u7f6e\u3059\u308b\u7802\u6642\u8a08\u578b\u306e\u30d6\u30ed\u30c3\u30af\u8981\u7d20\u306f\u3001h1 \u306e :before \u3068 :after \u3067\u4f5c\u308b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/hi3103.net\/notes\/img\/uploads\/2019\/04\/1904-ribon.jpg\" alt=\"\u30ea\u30dc\u30f3\u98a8\u898b\u51fa\u3057CSS\u306e\u89e3\u8aac\u56f3\" width=\"1900\" height=\"1152\"  \/><br \/>\n<!--more--><\/p>\n<p>\u624b\u9806\u306f\u3056\u3063\u304f\u308a\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<ol>\n<li>h1 \u306e line-height \u306b\u57fa\u6e96\u3068\u306a\u308b\u30ea\u30dc\u30f3\u306e\u9ad8\u3055\u3092\u6307\u5b9a (\u4eca\u56de\u306f3em)<\/li>\n<li>h1 \u306e\u5de6\u53f3\u306e margin \u306b\u3001\u6307\u5b9a\u3057\u305f\u9ad8\u3055\u306e\u534a\u5206\u306e\u5024\u3092\u30bb\u30c3\u30c8 (\u4eca\u56de\u306f3\u00f72=1.5em)<\/li>\n<li>h1:before \/ h1:after \u3092\u3001\u305d\u308c\u305e\u308c h1 \u306e\u5de6\u53f3 -1.5em \u306e\u4f4d\u7f6e\u306b\u914d\u7f6e<\/li>\n<li>h1 \u306e\u80cc\u666f\u8272\u3068\u3001h1:before \/ h1:after \u306e\u4e0a\u4e0b\u30dc\u30fc\u30c0\u30fc\u306e\u8272\u306b\u3001\u540c\u3058\u8272\u3092\u6307\u5b9a\u3059\u308b<\/li>\n<\/ol>\n<p>\u7d50\u679c\u7684\u306b\u3001\u540c\u3058\u8272\u304c\u305c\u3093\u3076\u7e4b\u304c\u3063\u3066\u898b\u3048\u3066\u30ea\u30dc\u30f3\u578b\u306b\u306a\u308b\u3002<br \/>\nh1:before \/ h1:after \u306e\u5de6\u53f3\u30dc\u30fc\u30c0\u30fc\u306e\u8272\u306f\u3001\u80cc\u666f\u8272\u3068\u5408\u308f\u305b\u3066\u3082\u3044\u3044\u304c\u3001\u900f\u660e(transparent)\u306b\u3057\u3066\u304a\u3051\u3070body\u7b49\u306e\u5730\u306e\u8272\u304c\u305d\u306e\u307e\u307e\u51fa\u305b\u308b\u3002<\/p>\n<h3>\u30b5\u30f3\u30d7\u30eb<\/h3>\n<p><a href=\"https:\/\/hi3103.net\/study\/1904-ribon\/\">https:\/\/hi3103.net\/study\/1904-ribon\/<\/a><\/p>\n<h3>\u30bd\u30fc\u30b9<\/h3>\n<h4>HTML<\/h4>\n<pre><code>&lt;h1&gt;\u3042\u3044\u3046\u3048\u304a&lt;\/h1&gt;<\/code><\/pre>\n<h4>CSS<\/h4>\n<p>\u203b\u524d\u63d0\uff1a\u30c7\u30d5\u30a9\u30eb\u30c8\u306eCSS\u8a2d\u5b9a\u306f\u30a4\u30cb\u30b7\u30e3\u30e9\u30a4\u30ba\u3055\u308c\u3066\u30d7\u30ec\u30fc\u30f3\u306a\uff08\u4f59\u767d\u7b49\u304c\u3064\u3044\u3066\u3044\u306a\u3044\uff09\u72b6\u614b\u3002<\/p>\n<pre><code>h1{\n    position: relative;\n    background-color: #000;\n    color: #FFF;\n    line-height: 3em;\n    text-align: center;\n    margin-left: 1.5em;\n    margin-right: 1.5em;\n}\nh1:after,\nh1:before{\n    display: block;\n    content: '';\n    position: absolute;\n    top:0;\n    border-top: 1.5em solid #000;\n    border-bottom: 1.5em solid #000;\n    border-right: 1.5em solid transparent;\n    border-left: 1.5em solid transparent;\n}\nh1:after{ left: -1.5em; }\nh1:before{ right: -1.5em; }<\/code><\/pre>\n<h3>\u53c2\u8003URL<\/h3>\n<ul>\n<li><a href=\"https:\/\/www.granfairs.com\/blog\/staff\/make-triangle-with-css\">CSS\u3060\u3051\u3067\u4e09\u89d2\u5f62\u3092\u4f5c\u308d\u3046\uff01\u305d\u306e1\uff1aborder\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u4ed5\u7d44\u307f\u3092\u30de\u30b9\u30bf\u30fc | \u682a\u5f0f\u4f1a\u793e\u30b0\u30e9\u30f3\u30d5\u30a7\u30a2\u30ba<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u3056\u3063\u304f\u308a\u3057\u305f\u89e3\u8aac \u4eca\u56de\u306f h1 \u8981\u7d20\u3092\u88c5\u98fe\u3059\u308b\u3002\u5de6\u53f3\u306b\u914d\u7f6e\u3059\u308b\u7802\u6642\u8a08\u578b\u306e\u30d6\u30ed\u30c3\u30af\u8981\u7d20\u306f\u3001h1 \u306e :before \u3068 :after \u3067\u4f5c\u308b\u3002<\/p>\n","protected":false},"author":1,"featured_media":1270,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[86],"class_list":["post-1269","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web","tag-css"],"_links":{"self":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts\/1269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/comments?post=1269"}],"version-history":[{"count":0,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts\/1269\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/media\/1270"}],"wp:attachment":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/media?parent=1269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/categories?post=1269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/tags?post=1269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}