divに囲まれたスライダがあります。各要素はこのdiv内に配置され、画像はdivの背景として設定されます。左には画像があり、右にはヘッダーとテキストと行動を促すボタンがあります。イメージとテキストが重複しないようにする
イメージをテキストのすぐ左に残したいとします。テキストの幅をさらに小さく設定すると、ページがモバイルで表示されているときに画像がテキストを読むことができなくなります。 HTML & .cssの実装は、この作業を行う最も簡単な方法と考えていますか?
.slide-email-thread {
background: url("http://4.imimg.com/data4/YP/FD/MY-13642581/hp-laptop-500x500.jpg") no-repeat bottom left;
background-size: contain;
height: 500px;
width: 120%;
bottom: 8px;
left: 16px;
}
.email-thread-header{
font-family: Arial,Helvetica,sans-serif;
padding-top: 20px;
padding-bottom: 20px;
font-size: 40px;
width: 95%;
margin: 0;
color: #FFFFFF;
font-weight: bold;
text-transform: uppercase;
}
.email-thread-text {
color:#FFFFFF;
font-size: 15px;
margin: 0 auto 30px;
width: 100%;
}
.email-thread-btn-link {
width: 50%;
}
.email-thread-button {
}
.email-thread-btn {
border: 2px solid #FFFFFF !important;
border-radius: 3px;
background-color: transparent !important;
text-decoration: none;
transition: background-color 0.5s ease, color 0.5s ease, border 0.5s ease;
font-size: 1.2em;
color: #FFFFFF !important;
padding: 1% 1%;
display: inline-block;
margin: 0 auto;
width: 30%;
}
.email-thread-btn:hover{
text-decoration: none;
color:#F8981D !important;
transition: background-color 0.5s ease, color 0.5s ease, border 0.5s ease;
background-color: #FFFFFF !important;
}
.slide-content {
margin:0px auto;
width:100%;
line-height:1.1
margin-top: -30px;
font-weight:400;
margin-bottom:30px;
width:75%;
text-align:left;
padding:20px;
}
<div class="gradient-bg-email-thread slide">
<div class="slide-email-thread">
<div class="slide-content">
<img src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQhhrwa3eP_qIPbSl9jCJe1JrAN7ahuI0IozBVF89fLJH0X7izl" style="padding-top: 20px;"/>
<div class="email-thread-header">Introducing My Site</div>
<div class="email-thread-text">My text is here & it is overlappng.</div>
<div class="email-thread-link"><a class="home_slide-banner email-thread-btn" href="example.com" target="_blank">CHECK IT OUT</a></div>
</div>
</div>
</div>
スライダーは、それのdivスライダー内の背景作りとは対照的に、単にdivの内側に画像を配置する方が良いだろう、div要素でなければなりませんか?
携帯端末で表示されるようにするには、画像に不透明度を追加してテキストを読むことができますか?より簡単なことがここにあるのは確かです。ここ
JSフィドル例:https://jsfiddle.net/b63xwb0z/
実用的なデモをお願いできますか? –
これを読みやすくするためにjsfiddleなどを投稿できますか? –
あなたのコードを使ってjsFiddleを作成しましたが(画像を変更しただけで画像が1つになる)、CSSが不足している可能性があります。意図したとおりではなく、好きではありません。そこには適切な行動もない)。 https://jsfiddle.net/tjvL10f7/ –