我通常在 WEB 页面中有 3 个区域(标题和副标题、2 个文本列和左侧的测试和右侧的图像)。我想得到以下结果:
但是我不知道怎么做,我认为它与葡萄酒图像的z-index有关,但是怎么做呢?我有这个:
我当前的代码是:
<header>
<div class="inner-header">
<h1><a title="title">titlw</a></h1>
<h2>subtitle</h2>
</div>
</header>
<section id="tagline">
<div id="tagline-content">column 1 and its text.</div>
<div id="tagline-content-middle">column 2 and its text.</div>
</section>
<section id="product">
<article class="product">
<img src="http://hmimexico.com/noir.png" alt="Girl" />
<h3>title</h3>
<p>Lorem Ipsum .</p>
</article>
</section>
CSS:
header {
margin-top: -40px;
height: 165px;
}
header .inner-header {
height:165px;
text-align:center;
}
header h1{
padding-top: 45px;
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.25);
margin-bottom:0;
}
header h2 {
color:#111111;
font-size: 19px;
line-height: 22px;
font-weight: bold;
letter-spacing: 1px;
margin-top:-2px;
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.15);
text-transform:uppercase
}
#tagline {
padding: 10px 0 10px 0;
background:#111 ;
text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.25);
}
#close-open-top {
margin: -9px auto;
text-align: center;
width: 50px;
}
#close-open-top a {
width:100px
}
#close-open-top:hover {
margin-top:-11px;
padding-bottom:2px
}
#tagline-content {
color: #FFFFFF;
text-align:left;
font-size: 10px;
font-weight: normal;
letter-spacing: 1px;
line-height: 100px;
text-transform: uppercase;
}
#tagline-content-middle {
color: #FFFFFF;
text-align:center;
font-size: 10px;
font-weight: normal;
letter-spacing: 1px;
line-height: 100px;
text-transform: uppercase;
}
#product {
text-align:center;
margin:16px auto;
padding-top:10px;
width:960px;
}
#product img {
float: right;
margin-left: 15px;
}
.product {
width:100%;
display:block;
margin:0;
text-align:left;
}
.product p {
color: #4F4F4F;
font-size: 16px;
line-height: 21px;
margin-bottom:38px
}
请看一下小提琴:http: //jsfiddle.net/2aEGp/1/
如何获得如图 1 所示的结果?