gpt4 book ai didi

html - 阶梯 Div 格式

转载 作者:太空宇宙 更新时间:2023-11-04 15:19:26 25 4
gpt4 key购买 nike

我有一个客户想要在他们的主页上使用一个特定的设计来匹配他们在杂志封面上看到的内容。封面的基本阶梯设计从未改变,但图像偶尔会改变。如果不使用 1 个大图像,我无法设计出一种方法来覆盖这种格式。

这是一个 fiddle :http://jsfiddle.net/z6ghY/

注意:此 fiddle 中的外观与客户希望看到的方式是正确的。我的问题是它使用了一个必须偶尔更改的大图像。如果这三张图片分开会容易很多。

有谁知道实现此目标的最佳方法吗?图像可以通过 HTML 或 CSS 放置,无论哪种方式都没有关系,但最好在 HTML 中看到它们以获得 SEO 好处。

如果 fiddle 没有在这里显示图像,那么它是.. http://i.imgur.com/6s2i9L7.png

HTML:

<h2>Innovative Engineering Solutions in Material Handling</h2>

<div class="home-container">
<div class="home-content"><p>Experience the impact that Lauyans &amp; Company can make on your business success. Through innovative engineering solutions in material handling, Lauyans will take responsibility for the planning, execution and acceptance of your project.</p>

<!--h2>Lauyans... why choose anyone else?</h2-->


<h2 style="margin: 80px 0 0 30px;">Lauyans...<br /> why choose<br /> anyone else?</h2>


</div><!-- END HOME CONTENT -->

</div><!-- END HOME CONTAINER -->

<div class="home-container2">
<div class="home-planning">
<h3>Planning</h3>
</div>
<div class="home-execution">
<h3>Execution</h3>
</div>
<div class="home-acceptance">
<h3>Acceptance</h3>
</div>
</div>

CSS:

.home-container { width: 690px; height: 459px; background: url('/wp-content/uploads/2013/01/home-image.png') 50% 100% no-repeat; }
.home-container2 { width: 690px; }
.home-content { width: 430px; height: 429px; padding: 15px; }
.home-content p { padding: 0; margin: 0; }
.home-content h2 { padding-top: 10px; margin: 0; }
.home-container2 h3 { padding-top: 0px; margin: 0; text-align: center; }
.home-planning { width: 230px; float: left; }
.home-execution { width: 230px; float: left; }
.home-acceptance { width: 230px; float: left; }

最佳答案

考虑到您想要的“独特”布局,我会采用绝对定位路线:

http://jsfiddle.net/z6ghY/1/

我修改了所有内容(包括我必须从其他地方抓取的图像):

HTML

<div class="home_con">

<h2 class="pge_title">Innovative Kitten Solutions</h2>

<div class="home_step">
<h2 class="step-title">Lauyans...<br /> why choose<br /> anyone else?</h2>

<p>
Experience the impact that Kittens can make on your business success through
purring.
</p>

<img class="img1" src="http://www.vivapets.com/img/album/52/19052_white_persian_kittens_for_adoption_thb.jpg" />

<img class="img2" src="http://www.saudivets.com/images/Vpic20.jpg" />

<img class="img3" src="http://fc04.deviantart.net/fs70/f/2011/167/2/8/kitten_tracks_banner_100x300_by_xxjessie_kittehxx-d3j2h51.png" />

</div>

<div class="img_text">
<div class="img_text_ele">Planning</div>
<div class="img_text_ele">Execution</div>
<div class="img_text_ele">Acceptance</div>
</div>

</div>

CSS

.home_con h2.pge_title { font-weight:bold; font-size:1.125em; }

.home_step { width:300px; height:300px; position:relative; }
.home_step h2.step-title { position:absolute; top:110px; left:10px; }
.home_step p { width:200px; position:absolute; top:10px; left:10px; }
.home_step img { position:absolute; bottom:0px; }
.home_step .img1 { left;0px; }
.home_step .img2 { left:100px; }
.home_step .img3 { left:200px; }

.home_con .img_text { width:300px; overflow:hidden; }
.home_con .img_text_ele { width:100px; float:left; text-align:center; }

关于html - 阶梯 Div 格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14755451/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com