{"id":160,"date":"2020-01-14T12:16:23","date_gmt":"2020-01-14T03:16:23","guid":{"rendered":"https:\/\/hira-s.net\/blog\/?p=160"},"modified":"2023-06-22T22:19:13","modified_gmt":"2023-06-22T13:19:13","slug":"position","status":"publish","type":"post","link":"https:\/\/hira-s.net\/blog\/position\/","title":{"rendered":"\u3010CSS\u3011position:absolute\u3067\u4e2d\u592e\u306b\u914d\u7f6e\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>css\u306eposition\u30bf\u30b0\u306f\u6307\u5b9a\u3055\u308c\u305f\u8981\u7d20\u306e\u914d\u7f6e\u65b9\u6cd5\u3092\u8abf\u6574\u51fa\u6765\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u3067\u3059\u304c\u3001\u305d\u306e\u4e2d\u3067\u3082\u4f7f\u7528\u983b\u5ea6\u304c\u9ad8\u3044\u3051\u3069\u3069\u3046\u66f8\u304f\u3093\u3060\u3063\u3051?\u3068\u306a\u308b\u4e8b\u304c\u591a\u3044absolute\u306e\u4e2d\u592e\u5bc4\u305b\u306b\u3064\u3044\u3066\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b5\u30f3\u30d7\u30eb<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">HTML<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&amp;lt;div class=&quot;sampleBox&quot;&gt;\n    &amp;lt;img src=&quot;https:\/\/hira-s.net\/blog\/wp-content\/uploads\/2019\/12\/8782.png&quot; alt=&quot;&quot;&gt;\n&amp;lt;\/div&gt;\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">CSS<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n.sampleBox {\n\tposition:relative;\n\t\n\t\/* \u30b5\u30f3\u30d7\u30eb\u7528\u8a18\u8ff0 *\/\n\twidth:100%;\n\theight:300px;\n\tmargin-bottom: 20px;\n}\n\n.sampleBox img {\n\tposition: absolute;\n\ttop: 50%;\n\tleft: 50%;\n\ttransform: translate(-50%, -50%);\n\t\n\t\/* \u30b5\u30f3\u30d7\u30eb\u7528\u8a18\u8ff0 *\/\n\twidth: 80px;\n\theight: auto;\n\tz-index: 10\/* \u4ed6\u306e\u91cd\u306a\u308a\u306b\u5408\u308f\u305b\u3066\u8abf\u6574 *\/;\n}\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\">\u30c7\u30e2<\/h3>\n\n\n\n<div class=\"sampleBox\">\n    <img decoding=\"async\" src=\"https:\/\/hira-s.net\/blog\/wp-content\/uploads\/2019\/12\/8782.png\" alt=\"\">\n<\/div>\n\n<style>\n\t.sampleBox {\n\t\tposition:relative;\n\t\t\n\t\t\/* \u30b5\u30f3\u30d7\u30eb\u7528\u8a18\u8ff0 *\/\n\t\twidth:100%;\n\t\theight:200px;\n\t\tbackground: #ccc;\n\t\tmargin-bottom: 20px;\n\t}\n\n\t.sampleBox::before{\n\t\tcontent: '';\n\t\twidth: 100%;\n\t\theight: 2px;\n\t\tbackground: #000;\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 0;\n\t\ttransform: translate(0, -50%);\n\t\tz-index: 9;\n\t}\n\n\t.sampleBox::after{\n\t\tcontent: '';\n\t\twidth: 2px;\n\t\theight: 100%;\n\t\tbackground: #000;\n\t\tposition: absolute;\n\t\ttop: 0%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\tz-index: 9:\n\t}\n\n\t.sampleBox img {\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -50%);\n\t\tz-index: 10;\n\t\t\n\t\t\/* \u30b5\u30f3\u30d7\u30eb\u7528\u8a18\u8ff0 *\/\n\t\twidth: 80px;\n\t\theight: auto;\n\t}\n<\/style>\n\n\n\n<p>\u7406\u5c48\u3068\u3057\u3066\u306f\u3001\u307e\u305atop\u3068left\u3067\u8d77\u70b9\u306e\u5de6\u4e0a\u304b\u308950%\u305a\u3064\u306e\u4f4d\u7f6e\u306b\u79fb\u52d5\u3055\u305b\u3001transform\u3067\u753b\u50cf\u81ea\u4f53\u306e\u5927\u304d\u3055\u306e50%\u5206\u3092\u623b\u3059\u3068\u3044\u3046\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002<br>\u4e0b\u8a18\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">transformt\u304c\u7121\u3044\u5834\u5408<\/h3>\n\n\n\n<div class=\"sampleBox02\">\n    <img decoding=\"async\" src=\"https:\/\/hira-s.net\/blog\/wp-content\/uploads\/2019\/12\/8782.png\" alt=\"\">\n<\/div>\n\n<style>\n\t.sampleBox02 {\n\t\tposition:relative;\n\t\t\n\t\t\/* \u30b5\u30f3\u30d7\u30eb\u7528\u8a18\u8ff0 *\/\n\t\twidth:100%;\n\t\theight:200px;\n\t\tbackground: #ccc;\n\t\tmargin-bottom: 20px;\n\t}\n\n\t.sampleBox02::before{\n\t\tcontent: '';\n\t\twidth: 100%;\n\t\theight: 2px;\n\t\tbackground: #000;\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 0;\n\t\ttransform: translate(0, -50%);\n\t\tz-index: 9;\n\t}\n\n\t.sampleBox02::after{\n\t\tcontent: '';\n\t\twidth: 2px;\n\t\theight: 100%;\n\t\tbackground: #000;\n\t\tposition: absolute;\n\t\ttop: 0%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\tz-index: 9:\n\t}\n\n\t.sampleBox02 img {\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\t\n\t\t\/* \u30b5\u30f3\u30d7\u30eb\u7528\u8a18\u8ff0 *\/\n\t\twidth: 80px;\n\t\theight: auto;\n\t\tz-index: 10;\n\t}\n<\/style>\n\n\n\n<p>\u4e0a\u306e\u72b6\u614b\u304b\u3089 transform \u3060\u3051\u629c\u3044\u305f\u5834\u5408\u3067\u3059\u3002\u5c11\u3057\u53f3\u4e0b\u65b9\u5411\u306b\u305a\u308c\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u753b\u50cf\u306e\u5de6\u6a4b\u304c\u7070\u8272\u306e\u30dc\u30c3\u30af\u30b9\u306e\u4e2d\u592e\u7dda\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br>\u30c7\u30e2\u306f\u3053\u3053\u304b\u3089transform\u3067\u753b\u50cf\u81ea\u4f53\u306e\u534a\u5206\u306e\u5927\u304d\u3055\u5206\u5de6\u4e0a\u65b9\u5411\u306b\u79fb\u52d5\u3055\u305b\u3066\u3044\u308b\u72b6\u614b\u3067\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u304b\u3064\u3001\u4e0a\u4e0b\u5de6\u53f3\u306b\u4e2d\u592e\u5bc4\u305b\u306b\u306a\u3063\u3066\u3044\u308b\u72b6\u614b\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u5fdc\u7528\u3067\u4e0a\u4e0b\u5de6\u53f3\u3060\u3051\u3067\u306a\u304f\u3001\u7e26\u65b9\u5411\u3001\u6a2a\u65b9\u5411\u306e\u307f\u306e\u4e2d\u592e\u5bc4\u305b\u3084\u5165\u529b\u3059\u308b%\u3092\u8abf\u6574\u3059\u308c\u3070\u8272\u3005\u3068\u5fdc\u7528\u304c\u5229\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5de6\u53f3\u65b9\u5411\u3060\u3051\u306e\u30d1\u30bf\u30fc\u30f3<\/h2>\n\n\n\n<div class=\"sampleBox03\">\n    <img decoding=\"async\" src=\"https:\/\/hira-s.net\/blog\/wp-content\/uploads\/2019\/12\/8782.png\" alt=\"\">\n<\/div>\n\n<style>\n\t.sampleBox03 {\n\t\tposition:relative;\n\t\t\n\t\t\/* \u30b5\u30f3\u30d7\u30eb\u7528\u8a18\u8ff0 *\/\n\t\twidth:100%;\n\t\theight:200px;\n\t\tbackground: #ccc;\n\t\tmargin-bottom: 20px;\n\t}\n\t\n\t.sampleBox03::before{\n\t\tcontent: '';\n\t\twidth: 100%;\n\t\theight: 2px;\n\t\tbackground: #000;\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 0;\n\t\ttransform: translate(0, -50%);\n\t\tz-index: 9;\n\t}\n\n\t.sampleBox03::after{\n\t\tcontent: '';\n\t\twidth: 2px;\n\t\theight: 100%;\n\t\tbackground: #000;\n\t\tposition: absolute;\n\t\ttop: 0%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\tz-index: 9:\n\t}\n\n\t.sampleBox03 img {\n\t\tposition: absolute;\n\t\ttop: 0%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\tz-index: 10;\n\t\t\n\t\t\/* \u30b5\u30f3\u30d7\u30eb\u7528\u8a18\u8ff0 *\/\n\t\twidth: 80px;\n\t\theight: auto;\n\t}\n<\/style>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e0a\u4e0b\u65b9\u5411\u3060\u3051\u306e\u30d1\u30bf\u30fc\u30f3<\/h3>\n\n\n\n<div class=\"sampleBox04\">\n    <img decoding=\"async\" src=\"https:\/\/hira-s.net\/blog\/wp-content\/uploads\/2019\/12\/8782.png\" alt=\"\">\n<\/div>\n\n<style>\n\t.sampleBox04 {\n\t\tposition:relative;\n\t\t\n\t\t\/* \u30b5\u30f3\u30d7\u30eb\u7528\u8a18\u8ff0 *\/\n\t\twidth:100%;\n\t\theight:200px;\n\t\tbackground: #ccc;\n\t\tmargin-bottom: 20px;\n\t}\n\t\n\t.sampleBox04::before{\n\t\tcontent: '';\n\t\twidth: 100%;\n\t\theight: 2px;\n\t\tbackground: #000;\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 0;\n\t\ttransform: translate(0, -50%);\n\t\tz-index: 9;\n\t}\n\n\t.sampleBox04::after{\n\t\tcontent: '';\n\t\twidth: 2px;\n\t\theight: 100%;\n\t\tbackground: #000;\n\t\tposition: absolute;\n\t\ttop: 0%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\tz-index: 9:\n\t}\n\n\t.sampleBox04 img {\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 0%;\n\t\ttransform: translate(0, -50%);\n\t\t\n\t\t\/* \u30b5\u30f3\u30d7\u30eb\u7528\u8a18\u8ff0 *\/\n\t\twidth: 80px;\n\t\theight: auto;\n\t\tz-index: 10;\n\t}\n<\/style>\n\n\n\n<h2 class=\"wp-block-heading\">\u7e2630%\u3001\u6a2a80%\u306e\u914d\u7f6e<\/h2>\n\n\n\n<div class=\"sampleBox05\">\n    <img decoding=\"async\" src=\"https:\/\/hira-s.net\/blog\/wp-content\/uploads\/2019\/12\/8782.png\" alt=\"\">\n<\/div>\n\n<style>\n\t.sampleBox05 {\n\t\tposition:relative;\n\t\t\n\t\t\/* \u30b5\u30f3\u30d7\u30eb\u7528\u8a18\u8ff0 *\/\n\t\twidth:100%;\n\t\theight:200px;\n\t\tbackground: #ccc;\n\t\tmargin-bottom: 20px;\n\t}\n\t\n\t.sampleBox05::before{\n\t\tcontent: '';\n\t\twidth: 100%;\n\t\theight: 2px;\n\t\tbackground: #000;\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 0;\n\t\ttransform: translate(0, -50%);\n\t\tz-index: 9;\n\t}\n\n\t.sampleBox05::after{\n\t\tcontent: '';\n\t\twidth: 2px;\n\t\theight: 100%;\n\t\tbackground: #000;\n\t\tposition: absolute;\n\t\ttop: 0%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, 0);\n\t\tz-index: 9:\n\t}\n\n\t.sampleBox05 img {\n\t\tposition: absolute;\n\t\ttop: 30%;\n\t\tleft: 80%;\n\t\ttransform: translate(-80%, -30%);\n\t\t\n\t\t\/* \u30b5\u30f3\u30d7\u30eb\u7528\u8a18\u8ff0 *\/\n\t\twidth: 80px;\n\t\theight: auto;\n\t\tz-index: 10;\n\t}\n<\/style>\n\n\n\n<h3 class=\"wp-block-heading\">\u6ce8\u610f\u70b9<\/h3>\n\n\n\n<p>absolute\u306f\u305d\u306e\u307e\u307e\u3060\u3068\u8d77\u70b9\u304c\u30d8\u30c3\u30c0\u30fc\u306e\u5de6\u4e0a\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u306e\u3067\u89aa\u8981\u7d20\u30921\u3064\u4f5c\u3063\u3066position: relative;\u306b\u3059\u308b\u306e\u3092\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>css\u306eposition\u30bf\u30b0\u306f\u6307\u5b9a\u3055\u308c\u305f\u8981\u7d20\u306e\u914d\u7f6e\u65b9\u6cd5\u3092\u8abf\u6574\u51fa\u6765\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u3067\u3059\u304c\u3001\u305d\u306e\u4e2d\u3067\u3082\u4f7f\u7528\u983b\u5ea6\u304c\u9ad8\u3044\u3051\u3069\u3069\u3046\u66f8\u304f\u3093\u3060\u3063\u3051?\u3068\u306a\u308b\u4e8b\u304c\u591a\u3044absolute\u306e\u4e2d\u592e\u5bc4\u305b\u306b\u3064\u3044\u3066\u3067\u3059\u3002 \u30b5\u30f3\u30d7\u30eb HTML CSS \u30c7\u30e2  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":184,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[48,7,46,47,49],"class_list":["post-160","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web","tag-absolute","tag-css","tag-html","tag-position","tag-49"],"acf":[],"views":1785,"_links":{"self":[{"href":"https:\/\/hira-s.net\/blog\/wp-json\/wp\/v2\/posts\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hira-s.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hira-s.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hira-s.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hira-s.net\/blog\/wp-json\/wp\/v2\/comments?post=160"}],"version-history":[{"count":31,"href":"https:\/\/hira-s.net\/blog\/wp-json\/wp\/v2\/posts\/160\/revisions"}],"predecessor-version":[{"id":529,"href":"https:\/\/hira-s.net\/blog\/wp-json\/wp\/v2\/posts\/160\/revisions\/529"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hira-s.net\/blog\/wp-json\/wp\/v2\/media\/184"}],"wp:attachment":[{"href":"https:\/\/hira-s.net\/blog\/wp-json\/wp\/v2\/media?parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hira-s.net\/blog\/wp-json\/wp\/v2\/categories?post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hira-s.net\/blog\/wp-json\/wp\/v2\/tags?post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}