質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.46%
CSS3

CSS(Cascading Style Sheet)の第3版です。CSS3と略されることが多いです。色やデザインを柔軟に変更することが可能になります。

HTML5

HTML5 (Hyper Text Markup Language、バージョン 5)は、マークアップ言語であるHTMLの第5版です。

レスポンシブWebデザイン

レスポンシブWebデザイン(RWD)は、スクリーンのサイズ、プラットフォーム、オリエンテーションに基づいて様々なデバイスで最適のサイトを生成するのウェブデザインとその開発のアプローチ方法を呼びます。

Q&A

0回答

912閲覧

position:absolute レスポンシブ対応について

kdog25da

総合スコア0

CSS3

CSS(Cascading Style Sheet)の第3版です。CSS3と略されることが多いです。色やデザインを柔軟に変更することが可能になります。

HTML5

HTML5 (Hyper Text Markup Language、バージョン 5)は、マークアップ言語であるHTMLの第5版です。

レスポンシブWebデザイン

レスポンシブWebデザイン(RWD)は、スクリーンのサイズ、プラットフォーム、オリエンテーションに基づいて様々なデバイスで最適のサイトを生成するのウェブデザインとその開発のアプローチ方法を呼びます。

0グッド

0クリップ

投稿2021/07/05 11:11

前提・実現したいこと

スマホバージョンの時に以下のような表示にしたい。
イメージ説明

PC版は以下のようで問題ないがスマホ版の場合、レスポンシブが不具合となるので上記のようにしたい。
イメージ説明

発生している問題・エラーメッセージ

イメージ説明
イメージ説明

該当のソースコード

index.html <section class="struggle section"> <div class="inner struggle-inner"> <div class="section-top"> <span class="section-sub">ssss</span> <h2 class="section-title">aaaa</h2> <div class="section-circle">・・・</div> </div> <div class="struggle-content"> <div class="struggle-picture"> </div> <div class="struggle-message"> <p class="struggle-message-title">Eeeeとかいて fffffです Aaaa </p> <p class="struggle-message-text">テストテストテストテストテストテスtテストテストテストテストテストテスtテストテストテストテストテストテストテストテストテストテストテスtテストテストテストテストテストテスtテストテストテストテストテスト</p> </div> </div> </div> </section> <section class="service section"> <div class="inner service-inner"> <div class="section-top"> <span class="section-sub">aaaaa</span> <h2 class="section-title">aaa</h2> <div class="section-circle">・・・</div> </div> <div class="service-content"> <div class="service-picture"> </div> <div class="service-message"> <p class="service-message-title">Eeeeとかいて fffffです Aaaa </p> <p class="service-message-text">登録制にイタズラを防いで様々な人達に魅力を伝えます。そのような業務をこれからも実行していきます。何卒、よろしくお願いします。テストテストテストテストテストテスtテストテストテストテストテストテスtテストテストテストテストテストテスt</p> </div> </div> </div> </section>
style.css .container { width: 1366px; max-width: 100%; margin: 0 auto; padding: 0 83px; } .section { padding-top: 127px; @include mq(sp) { padding-top: 85px; } } .section-top { text-align: center; margin-bottom: 55px; letter-spacing: 0.25rem; .section-sub { color: pink; font-size: 18px; } .section-title { font-size: 36px; margin-top: 27px; font-weight: bold; letter-spacing: 0.1rem; } .section-circle { color: pink; } } .inner { padding: 0 143px; max-width: 100%; margin: 0 auto; width: 1366px; @include mq(sp) { padding: 0 30px; } } .struggle { } .struggle-inner { @include mq(sp){ padding: 0 30px 0 0; } } .struggle-content { position: relative; @include mq(sp) { // position: static; } } .struggle-picture { padding-top: 45%; background: url(../../img/js.jpeg) top left / 59% no-repeat; @include mq(sp) { padding-top: 100%; background: url(../../img/js.jpeg) center center/ cover no-repeat; } } .struggle-message { @include mq(pc) { position: absolute; top: 50%; transform: translateY(-50%); right: 0; margin: 0 0 0 auto; padding: 50px; width: 58%; } box-shadow: 4px 4px 20px #EBE7E1; background: #fff; @include mq(sp) { padding: 40px 30px; width: 84%; margin: 0 0 0 auto; // position: static; } &-title { font-size: 28px; margin-bottom: 45px; letter-spacing: 0.1rem; line-height: (56 / 28); color: #333; @include mq(sp) { font-size: 18px; margin-bottom: 32px; } } &-text { letter-spacing: 0.1rem; line-height: (36 / 16); @include mq(sp) { font-size: 14px; } } } .service { } .service-inner { @include mq(sp){ padding: 0 0 0 30px; } } .service-content { position: relative; @include mq(sp) { position: static; } } .service-picture { padding-top: 45%; background: url(../../img/js.jpeg) top right / 59% no-repeat; @include mq(sp) { padding-top: 100%; background: url(../../img/js.jpeg) center center/ cover no-repeat; } } .service-message { @include mq(pc) { position: absolute; top: 50%; transform: translateY(-50%); left: 0; margin: 0 0 0 auto; padding: 50px; width: 58%; } box-shadow: 4px 4px 20px #EBE7E1 ; background: #fff; @include mq(sp) { padding: 30px; width: 84%; margin: 0 auto 0 0; } &-title { font-size: 28px; margin-bottom: 45px; color: #333; letter-spacing: 0.1em; line-height: (64 / 28); @include mq(sp) { font-size: 18px; margin-bottom: 32px; } } &-text { line-height: (36 / 16); letter-spacing: 0.1em; @include mq(sp) { font-size: 14px; } } }

試したこと

ここに問題に対して試したことを記載してください。

補足情報(FW/ツールのバージョンなど)

ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.46%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問