お世話になっております。
以下の画像のように右斜め上(before)と、左斜め下(after)に擬似要素を表示させ、レスポンシブ対応にも対応できるようにしたいです。
右斜め上は動かないんですが、左斜め下は画面幅によって位置が動きます。
左斜め下も動かしたくないのですが、解決方法がわかりません、、、。
どなたか、ご教授の程よろしくお願い致します。
html
1 <div class="price_txt"></div>
css
1 2.price_txt { 3 position: relative; 4 background-color: #eae4e2; 5} 6 7.price .price_inner .price_txt::before { 8 display: inline-block; 9 content: url(../img/text_inner_up_sp.png); 10 position: absolute; 11 top: 0; 12 left: 0; 13 width: 10vw; 14 height: 10vw; 15 -webkit-transform: scale(0.5); 16 -ms-transform: scale(0.5); 17 transform: scale(0.5); 18 } 19 20 .price .price_inner .price_txt::after { 21 display: inline-block; 22 content: url(../img/text_inner_down_sp.png); 23 position: absolute; 24 bottom: 20%; 25 right: 30%; 26 width: 10vw; 27 height: 10vw; 28 -webkit-transform: scale(0.5); 29 -ms-transform: scale(0.5); 30 transform: scale(0.5); 31 } 32
回答1件
あなたの回答
tips
プレビュー