这种布局在网络上几乎无处不在,但似乎没有人提供任何关于它如何工作的信息。我需要将内容居中,并且背景需要扩展页面的整个宽度示例http://www.fuerstlaw.com/(蓝色 bg 颜色扩展了整个宽度)。这是如何使用 CSS 完成的?我觉得这很简单,但就是想不通。
这是我的代码,因为我只是想至少让标题在此链接上工作到该站点的测试页面http://gsringolaw.com/home
body {
margin: 0;
padding: 0;
}
#wrapper {
width: 960px;
margin: 0 auto;
}
#masthead {
min-width: 100%;
margin: 0px;
padding: 0px;
background-position: 0px 0px;
background-color: #00304F;
position: relative;
z-index: 0;
}
#headertext {
position: relative;
width: 250px;
height: 82px;
font-family: Georgia, "Times New Roman", Times, serif;
color: #FFFFFF;
font-size: large;
top: -41px;
left: 704px;
}
#glow {
height: 170px;
background-image: url('images/glow.png');
position: relative;
background-repeat: no-repeat;
background-position: center;
top: -192px;
left: -13px;
width: 973px;
}
#logo {
position: relative;
background-image: url('images/gayleringo.png');
background-repeat: no-repeat;
width: 528px;
height: 113px;
top: 28px;
left: 0px;
}
<div id="wrapper">
<div id="masthead" style="height: 171px">
<div id="logo">
</div>
<div id="headertext" class="auto-style1">
Louisiana: 504-975-0180<br />
<br />
Florida: 850-292-7059</div>
<div id="glow">
</div>
</div>
<div id="top_nav">
</div>
<div id="container">
<div id="right_col">
</div>
<div id="page_content">
</div>
</div>
<div id="footer">
</div>
</div>