【发布时间】:2012-02-26 22:21:48
【问题描述】:
我试图让一个标题从浅蓝色到蓝色淡入淡出,一个蓝色的中心和一个蓝色到浅蓝色的右侧淡出。标题的宽度必须为 100%。有人可以告诉我这是否是拥有一个 css 驱动的标题部分的最佳方法,它由一个左淡入淡出(淡出的背景图像)、一个右淡入淡出和一个中心标题部分组成。我遇到的问题是当前的方式是在设置像素时溢出/限制我,以防有人决定调整浏览器窗口的大小。任何帮助将不胜感激.. 干杯。
<div id="header">
<div id="leftfade"></div>
<div id="header_container">
<div id="languagechooser"></div>
<div id="logo"></div>
<div id="navbar">
<ul>
<li class="navleft"><a href="aa.a">HOME</a></li>
<li><a href="aa.a">xxxxxxxx</a></li>
<li><a href="aa.a">xxxxxxxxxxxx</a></li>
<li><a href="aa.a">xxxxxxxxxx</a></li>
<li><a href="aa.a">xxxxxxxxxxxx</a></li>
</ul>
</div>
</div>
<div id="rightfade"></div></div>
body{
background: #FFFFFF;
margin: 0px auto;
font-size: 62.5%;
color:#000000;
width:100%;
min-width:965px;}
#header{
position:relative;
height:157px;
background-color:#74d7ea;}
#header #leftfade
{
float:left;
background: url(../img/header_leftfade.png) repeat-y top left;
width:25%;
height:157px;}
#header #rightfade{
position:absolute;
right:0;
background: url(../img/header_rightfade.png) repeat-y top right;
width:25%;
height:157px;}
#header #header_container{
float:left;
position:relative;
text-align:left;
min-width:50%;
height:157px;}
#header #logo{
float:left;
background: url(../img/logo.png) no-repeat;
width:408px;
height:63px;
margin-top:20px;}
#header #languagechooser{
float:right;
width:150px;
height:50px;
background-color:#ffffff;
margin-left:100px;}
#header #navbar{
clear:both;
position:relative;
top:15px;
height:30px;
background-color:#63bdce;
width:98%;
overflow:hidden;}
#header #navbar ul{ list-style:none;}
#header #navbar ul li{ float:left;}
#header #navbar ul li a{
background: url(navi_bg_divider.png) no-repeat right;
padding-right: 12px;
font: bold 1.7em Myriad Pro, Arial, Helvetica, sans-serif;
padding-left: 12px;
display: inline-block;
line-height: 30px;
text-decoration: none;
color:#ffffff;}
【问题讨论】: