ご質問失礼します。
地図の画像を重ねて上に表示させたいのですが、ご教示いただければ幸いです。
マイナスマージンとz-indexwを試したのですが、上手くいきません。
地図が青い画像の下に潜っているので、地図を上に表示させたいのです。
PHP
1<section id="access" class="access"> 2 <div class="container"> 3 <div class="section-header"> 4 <h2><img class="img-fluid" src="<?php echo get_template_directory_uri(); ?>/images/title-access.png" alt="title-access"></h2> 5 </div> 6 <div class="row"> 7 <div class="col-md-6"> 8 <img class="img-fluid access-map" src="<?php echo get_template_directory_uri(); ?>/images/access-map.png" alt="access-map"> 9 </div> 10 <div class="col-md-6"> 11 <h3>東京都立産業貿易センター大東館</h3> 12 <p>〒111-0033<br>東京都台東区花川戸2-6-5</p> 13 <a class="btn btn-access" href="#">Googleマップを開く</a> 14 </div> 15 </div> 16 </div> 17 </section><!-- .access -->
SCSS
1.news { 2 position: relative; 3 padding: 20rem 0 70rem 0; 4 background: 5 url(images/illust-news01.png) 90% 60% no-repeat, 6 url(images/illust-access02.png) 5% 0% no-repeat, 7 url(images/bg-news.png) center top /cover no-repeat; 8} 9 10.news .news-img { 11 display: block; 12 margin: 0 auto; 13} 14 15.news .lines { 16 border-top: .1rem solid $white; 17} 18 19.news ul { 20 list-style: none; 21 color: $white; 22 @include media-breakpoint-down(sm) { 23 margin-bottom: 3rem; 24 } 25} 26ul li { 27 width: 100%; 28 border-bottom: 1px solid $white; 29} 30 31.news .twitter-timeline { 32 position: absolute !important; 33 top: 74rem; 34 left: 40rem; 35 @include media-breakpoint-down(sm) { 36 position: relative !important; 37 top: 0; 38 left: 0; 39 } 40} 41 42.entry-date { 43 margin-bottom: 0; 44 @include media-breakpoint-down(sm) { 45 display: block; 46 margin-bottom: .5rem; 47 } 48} 49 50.news .entry-title { 51 display: inline-block; 52 font-size: 1rem; 53 @include media-breakpoint-down(sm) { 54 display: block; 55 } 56}
完成しました、ありがとうございます。
SCSS
1/*-------------------------------------------------------------- 2# access 3--------------------------------------------------------------*/ 4.access { 5 padding-top: 10rem; 6 background: 7 url(images/illust-access01.png) 50% 10% no-repeat; 8} 9 10.access .access-map { 11 position: absolute; 12 padding: 0 1.8rem; 13 z-index: 1; 14 @include media-breakpoint-down(sm) { 15 position: static; 16 padding: 0 0; 17 margin-bottom: 1rem; 18 z-index: 0; 19 } 20}
具体的にHTMLおよびCSSを質問文に追記されたほうが回答を得られやすいと思います。
ありがとうございます。追記しておきます。
どの程度重ねたいとか現状どうなっているかとか、詳細を追記願います。質問冒頭の画像が何をさしているか分かりません。
地図が青い画像の下に潜っているので、地図を上に表示させたいのですがいかがでしょうか。
質問文に追記してください。ここでは(他の回答者の目につかない可能性も高くなり)埋もれます。
提示されたコードはSASSのコードでは?質問タグに「SASS」を追加するか、出力されたCSSを提示されてはいかがでしょう。
ご提示されているscssのコードは質問内容の部分でしょうか。基本的には重ねたい方の画像にposition:absoluteとz-index:(好きな値)を設定する感じになると思いますが…。
ありがとうございます。position:absoluteとz-indexの指定でできました。
回答1件
あなたの回答
tips
プレビュー