Html 使div全宽并固定
我的网站设计有问题 每当我的浏览器是全屏(最大化)时,我的页眉和页眉下都是全宽的。 尽管如此,只要我开始调整浏览器屏幕的大小,我的标题和标题下的内容就乱七八糟了 我在这张图中说明了绘画中的以下问题: 在下图中,调整了浏览器屏幕的大小。如您所见,内容保留在它应该保留的位置(已修复)。尽管如此,标头和udnerheader不是 我的HTML是:Html 使div全宽并固定,html,css,fixed,Html,Css,Fixed,我的网站设计有问题 每当我的浏览器是全屏(最大化)时,我的页眉和页眉下都是全宽的。 尽管如此,只要我开始调整浏览器屏幕的大小,我的标题和标题下的内容就乱七八糟了 我在这张图中说明了绘画中的以下问题: 在下图中,调整了浏览器屏幕的大小。如您所见,内容保留在它应该保留的位置(已修复)。尽管如此,标头和udnerheader不是 我的HTML是: <div class="header"> <div class="headercontainer">
<div class="header">
<div class="headercontainer">
HEADER TEXT
</div><!-- End Header Container -->
</div><!-- End Header -->
<div class="underheader">
<div class="wrapper">
<div class="undertext">
<div class="row" style="margin:0px 0px 0px 0px;">
<div class="column grid_16">
<a href="?i=h"><div class="logo"></div></a>
<div class="menu">
<ul class="toolbar">
<li><a class="dark" href="#">Home</a></li>
<li><a class="dark" href="#">View Advertisements <span>5</span> </a></li>
<li><a class="dark" href="#">Dashboard</a></li>
<li><a class="dark" href="#">Forum</a></li>
</ul>
</div>
</div><!-- End Grid_16 -->
</div><!-- End Row -->
</div><!-- End Under Text -->
</div><!-- End Wrapper -->
</div><!-- End Under Header -->
我做错了什么?我试过位置:固定
您可以在这里看到整个CSS:所以问题是页眉和页眉下的大小随浏览器窗口的变化而变化,而内容却不随浏览器窗口的变化而变化?标题下方另一个div中的内容是否为?你的照片显示了这一点。内容是否设置了明确的宽度?如果不想调整页眉和页眉下的宽度,请尝试设置页眉和页眉下的宽度。页眉上没有任何宽度、显示、位置或浮动属性。页眉使人感到奇怪的是,它的行为方式与标准不同。你真的确定只有这些样式可以应用吗?没有其他CSS,任何地方都没有JavaScript?其中包含的头和下头是什么?也许这就是问题所在?问题在于,调整浏览器大小时,页眉和页眉的宽度(与内容一样)不全。你们都可以在这里自由地看到整个.css:嗯,在Chrome或IE9中,我似乎没有你们描述的问题,尽管在IE中看起来不太好(令人惊讶)。它可以随窗口调整大小,您使用的是哪个浏览器?
.header{
background: rgb(52,139,183); /* Old browsers */
background: -moz-linear-gradient(top, rgba(52,139,183,1) 0%, rgba(48,123,167,1) 45%, rgba(45,112,157,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(52,139,183,1)), color-stop(45%,rgba(48,123,167,1)), color-stop(100%,rgba(45,112,157,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(52,139,183,1) 0%,rgba(48,123,167,1) 45%,rgba(45,112,157,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(52,139,183,1) 0%,rgba(48,123,167,1) 45%,rgba(45,112,157,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(52,139,183,1) 0%,rgba(48,123,167,1) 45%,rgba(45,112,157,1) 100%); /* IE10+ */
background: linear-gradient(top, rgba(52,139,183,1) 0%,rgba(48,123,167,1) 45%,rgba(45,112,157,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#348bb7', endColorstr='#2d709d',GradientType=0 ); /* IE6-9 */
-moz-box-shadow: 0px 1px 4px #979797;
-webkit-box-shadow: 0px 1px 4px #979797;
box-shadow: 0px 1px 4px #979797;
color:#fff;
padding:10px;
border-color:#000;
border-width:0px 0px 1px 0px;
border-style:solid;
min-height:32px;
}
.headercontainer{
margin-left:6%;
margin-right:6%;
}
.headertext{
padding-top:10px;
padding-left:15px;
float:left;
}
.underheader{
margin-top:2px;
background: rgb(249,249,249); /* Old browsers */
background: -moz-linear-gradient(top, rgba(249,249,249,1) 0%, rgba(224,224,224,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(249,249,249,1)), color-stop(100%,rgba(224,224,224,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(249,249,249,1) 0%,rgba(224,224,224,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(249,249,249,1) 0%,rgba(224,224,224,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(249,249,249,1) 0%,rgba(224,224,224,1) 100%); /* IE10+ */
background: linear-gradient(top, rgba(249,249,249,1) 0%,rgba(224,224,224,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9f9f9', endColorstr='#e0e0e0',GradientType=0 ); /* IE6-9 */
-moz-box-shadow: 0px 1px 3px #c1c1c1;
-webkit-box-shadow: 0px 1px 3px #c1c1c1;
box-shadow: 0px 1px 3px #c1c1c1;
border-color:#aeaeae;
border-width:0px 0px 1px 0px;
border-style:solid;
}
.underheader .undertext{
padding:10px;
}
.underheader .wrapper{
background-image:url("../images/wrapper.png");
background-repeat:no-repeat;
background-position:center;
}