第二部分为什么我把文字区和图片去位置换了,图片却不靠右
如图,第二部分,文字和图片换了位置后,图片不靠右,还和文字重叠,这种情况一般怎么修改请问??
如图,第二部分,文字和图片换了位置后,图片不靠右,还和文字重叠,这种情况一般怎么修改请问??
2015-08-20
.gray-section { background: #252f34; color:#fff; } .gray-section .img-section { width: 45%; } .img-section img { width: 100%; } .gray-section .text-section { width: 55%; } .article-preview > div { float: left; } .article-preview:nth-child(odd) { background-color: rgba(0,0,0,0.05); } .article-preview:after { content: ''; display: block; clear: both; } .text-section { position: relative; top: 68px; left: 50px; } .text-section h2 { margin-bottom: 20px; } .text-section p { font-size: 18px; letter-spacing: 1px; margin-right: 30px; } .text-section .sub-heading { font-size: 22px; margin-top: 0; }
<section class="green-section"> <div class="wrapper"> <div> <h2>一个标题</h2> <div class="hr"></div> <p>lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div> <div class="icon-group"> <span class="icon">item1</span> <span class="icon">item2</span> <span class="icon">item3</span> </div> </div> </section> <section class="gray-section"> <div class="article-preview"> <div class="text-section"> <h2>愿得一人心</h2> <div class="sub-heading"> 白首不相离 </div> <p>lorem ipsum dolor sit amet,consectetur adipisicing elit. Atque natus veniam illo,vitae nulla quisquam elit officiis minima iure.</p> </div> <div class="img-section"> <img src="img/pic01.jpg"alt=""> </div> </section> <section class="gray-section"> <div class="article-preview"> <div class="img-section"> <img src="img/pic02.jpg"alt=""> </div> <div class="text-section"> <h2>愿得一人心</h2> <div class="sub-heading"> 白首不相离 </div> <p>lorem ipsum dolor sit amet,consectetur adipisicing elit. Atque natus veniam illo,vitae nulla quisquam elit officiis minima iure.</p> </div> </section> <section class="gray-section"> <div class="article-preview"> <div class="text-section"> <h2>愿得一人心</h2> <div class="sub-heading"> 白首不相离 </div> <p>lorem ipsum dolor sit amet,consectetur adipisicing elit. Atque natus veniam illo,vitae nulla quisquam elit officiis minima iure.</p> </div> <div class="img-section"> <img src="img/pic03.jpg"alt=""> </div> </section>
举报