这里有两张屏幕截图,展示了在必须滚动的小视口下的效果。
HTML代码如下:(忽略head和html标签)
我该如何解决这个问题?据我所知,我需要将渐变放在另一个div上,因为我需要指定高度。
(我知道CSS渐变在IE中不起作用 - 这里有一个背景图片来模拟这种行为。它也有同样的问题。)
HTML代码如下:(忽略head和html标签)
<body>
<div id="grad1"></div>
<div id="wrapper">
<header>
<h1 class="logo"><a href="/">Business Name</a></h1>
</header>
<nav>
<ul>
<li><a class="first" id="index" href="/index.php">Home</a></li>
<li><a id="whatwedo" href="/whatwedo.php">What we do</a></li>
<li><a id="communicating" href="/communicating.php">Communicating</a></li>
<li><a class="last" id="contact" href="/contact.php">Contact Us</a></li>
</ul>
</nav>
<div style="clear:both;"></div>
<section>
<?= $content ?>
</section>
<footer>
© 2010
</footer>
</div>
</body>
以下是与 body、grad1 和 wrapper 相关的(精简版)CSS:
body {
color: #111;
background-color: #3E9C9D;
}
#grad1 {
height: 600px;
position: absolute;
top: 0;
left: 0;
z-index: -100;
width: 100%;
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#3E9C9D));
background-image: -moz-linear-gradient(#fff 0%, #3E9C9D 100%);
}
#wrapper {
max-width:960px;
min-width:840px;
margin: 0 auto;
}
我该如何解决这个问题?据我所知,我需要将渐变放在另一个div上,因为我需要指定高度。
(我知道CSS渐变在IE中不起作用 - 这里有一个背景图片来模拟这种行为。它也有同样的问题。)