2013-11-20 44 views
0

这是我第一次评论这个网站。我发现这个网站在过去有帮助,但现在我似乎无法找到解决我的问题,我希望有人直接回答我。html和css网页内容调整

我有网页使用的地方,我有一个固定的页眉和页脚和绝对定位面板的内容去。我的问题是,当我调整浏览器的大小时,标题内容保持在固定位置>现在很明显,我希望通过页面其余部分的滚动进行移动。当我将标题设置为相对时,它确实符合我的要求,但标题导航链接位于我的低频带下,z-indexing无济于事。页脚也是如此。 此外,对于内容面板,当我将主体溢出设置为自动或显示时,内容面板在滚动时会将空白留给右侧。 任何人都可以帮我解决这个问题吗?这是非常令人沮丧的。 还有一件事,任何人都可以帮我用代码来使用css来获取我的ux-header-upperbandcontent和lowebandcontent ?.我想将徽标和其他文本放置在较低频段的上层和导航链接中,但使用内容包装器。

谢谢。这是我的代码为CSS和HTML

<!DOCTYPE html> 
<html> 
<head> 
<link rel="stylesheet" type="text/css" href="content/style.css"> 
</head> 
<body> 
<!--BACKGROUND--> 

<!--HOME--> 
<div id="home"> 
</div> 
<!--ABOUT--> 
<div id="about" class="panel"> 
<div class="content"> 
<p>about content</p> 


</div> 
</div> 
<!--SERVICES--> 
<div id="services" class="panel"> 
<div class="content"> 
<p>services content</p> 


</div> 


</div> 
<!--CONTACT--> 
<div id="contact" class="panel"> 
<div class="content"> 
<p>contact content</p> 


</div> 
</div> 
<!--HEADER--> 

<div id="ux-header"> 
<div id="ux-header" class="upperband"> 
</div> 
<div id="ux-header" class="lowerband"> 
</div> 
<div id="ux-header"> 
<ul id="ux-header" class="dev-navigation"> 
<li><a id="dev-home" href="#home">HOME</a></li> 
<li><a id="dev-services" href="#services">SERVICES</a></li> 
<li><a id="dev-about" href="#about">ABOUT</a></li> 
<li><a id="dev-contact" href="#contact">CONTACT</a></li> 
</ul> 

</div> 
</div> 


<!--FOOTER--> 
<div id="ux-footer">  
</div> 
</body> 
</html> 




body { 
min-width:980px; 
margin: 0px; 
color: rgb(51, 51, 51); 
line-height: 30px; 
font-family: "Segoe UI","Helvetica",Garuda,Arial,sans-serif; 
font-size: 0.81em; 
cursor: default; 
overflow:hidden; 
} 
a { 
color: rgb(0, 68, 204); 
text-decoration: none; 
cursor: pointer; 
} 
img { 
border:currentColor; 
border-image: none; 
max-width: 100%; 
} 
ul { 
margin: 0px; 
padding: 0px; 
} 
ol { 
margin: 0px; 
padding: 0px; 
} 
li { 
margin: 0px; 
padding: 0px; 
} 
p { 
margin: 0px; 
padding: 0px; 
} 
ul { 
margin-bottom: 0px; 
} 
ul li { 
margin-bottom: 0px; 
margin-left: 15px; 
} 
ol li { 
margin-bottom: 2px; 
margin-left: 18px; 
} 
p { 
margin-bottom: 10px; 
} 
h1 { 
margin: 0px; 
color:rgb(104, 33, 122); 
font-weight: normal; 
} 
h2 { 
margin: 0px; 
color:rgb(104, 33, 122); 
font-weight: normal; 
} 
h3 { 
margin: 0px; 
color:rgb(104, 33, 122); 
font-weight: normal; 
} 
h1 { 
line-height: 42px; 
font-size: 2.77em; 
margin-bottom: 20px; 
} 
h1.error { 
margin-top: 50px; 
} 
h2 { 
line-height: 34px; 
font-size: 2.16em; 
margin-bottom: 20px; 
} 
h3 { 
line-height: 24px; 
font-family: "Segoe UI Semibold","Segoe UI",Tahoma,"Microsoft Sans Serif",Verdana,sans-serif; 
font-size: 1.39em; 
margin-bottom: 20px; 
} 
h4 { 
margin: 0px 0px 10px; 
color: rgb(51, 51, 51); 
line-height: 20px; 
font-family: "Segoe UI Semibold","Segoe UI",Tahoma,"Microsoft Sans Serif",Verdana,sans-serif; 
font-size: 1.08em; 
} 
#ux-header.dev-navigation { 
margin-top:60px; 
width:300px;  
z-index:3; 
left:70%; 
white-space:nowrap; 
} 
#ux-header .dev-navigation li{ 
padding-right:10px; 
margin:10px; 
} 
#ux-header ul.dev-navigation li{ 
display:inline; 
} 
#ux-header.dev-navigation li a { 
text-transform:uppercase; 
font-size:12px; 
padding-bottom:0px; 
margin-bottom:0px; 
} 
#ux-header.dev-navigation li a:hover { 
padding-bottom:3px; 
border-bottom-style:solid; 
border-bottom-color:#4169E1; 
border-bottom-width:10px; 
} 
#ux-header { 
position:fixed; 
top:0px; 
z-index:2000; 
width:100%; 
overflow:hidden; 
} 
#ux-header a { 
color:#FFF; 
} 
#ux-header ul { 
margin:0px; 
} 
#ux-header li { 
margin:0px; 
} 
#ux-header .upperband{ 
height:60px; 
background-color:#000; 
} 
#ux-header.upperbandcontent { 
margin:0px, auto; 
padding:0px, 10px; 
width:100%; 
max-width:980px; 
} 
#ux-header .lowerband { 
top:60px; 
height:30px; 
background-color:#F42; 
} 
#ux-header.lowerbandcontent { 
position:absolute; 
margin:0px, 0px, 5px, 0px; 
padding:0px, 10px; 
width:100%; 
max-width:980px; 
} 
#ux-footer { 
position:fixed; 
bottom:0px; 
width:100%; 
height:50px; 
background-color:#000; 
border-top-style:solid; 
border-top-width:8px; 
border-top-color:#0000FF; 
z-index:2000; 
} 
.content { 
font-size:12px; 
padding:3px; 
line-height:10px; 
color:#fff; 
display:inline-block; 
margin:3px 0px; 
z-index:-1; 
} 
.content h2{ 
font-size: 30px; 
padding: 10px 0px 20px 0px; 
margin-top: 52px; 
color: #fff; 
color: rgba(255,255,255,0.9); 
text-shadow: 0px 1px 1px rgba(0,0,0,0.3); 
} 
.content p{ 
font-size: 12px; 
padding: 3px; 
line-height: 16px; 
color: #fff; 
display: inline-block; 
margin: 3px 0px; 
} 
.panel { 
position:absolute; 
min-width:100%; 
min-height:80%; 
margin-top:90px; 
right:2000px; 
background-color:#FF00FF; 
z-index:-2; 
transition:right 2s; 
overflow:hidden; 
} 
.panel:target { 
background-color:#F6A600; 
right:0;  
} 
#home:target ~ #ux-header .dev-navigation #dev-home, 
#about:target ~ #ux-header .dev-navigation #dev-about, 
#services:target ~ #ux-header .dev-navigation #dev-services, 
#contact:target ~ #ux-header .dev-navigation #dev-contact,{ 
    color:#000; 
} 
+0

哪里是代码? – San

+0

对不起,我无法发布它,它现在在那里。 – user3013330

+0

我认为我可以使用java脚本,当标题大小低于某个宽度时,它会变成菜单样式的naviation和页脚内容。但对于内容,在主页上我会有一个视频,这可能会造成问题? – user3013330

回答

0

这是你在找什么?

http://jsfiddle.net/cancerian73/huawb/

@media screen and (max-width: 400px) { 
/* grid4 */ 
.col { 
    width: 100% !important; 
    margin-left: 0 !important; 
    clear: none !important; 
} 
} 
+0

嗨,感谢你的回应,但它不是我想要的。我的意思是当我调整浏览器宽度时,我的内容被隐藏起来。当我将我的身体溢出设置为滚动或自动时,内容区域/面板将向左滚动或向右滚动,这是我想要的,但由于调整大小宽度,当您滚动时,面板/内容区域的右侧会出现空白。 – user3013330

+0

提供了一个小提琴,所以我可以理解 – San

+0

这是我的小提琴后,你做了更改..你需要点击更新小提琴 – San