我有一个用于“服务”链接的下拉菜单,但是当我尝试建立链接时(我知道颜色和东西都掉了,我稍后再修复),它消失在页面内容的后面。救命!
这是CSS:
body {
margin: 0 13% 0 13%;
padding:0;
border:0; /* This removes the border around the viewport in old versions of IE */
width:100%;
background-image:url('bg.jpg');
background-size: 100% auto;
background-attachment:fixed;
background-repeat: no-repeat;
min-width: 600px;
max-width: 1200px;
font-size:90%;
}
h1, h2, h3 {
margin:.8em 0 .2em 0;
padding:0;
}
p {
margin:.4em 0 .8em 0;
padding:0;
}
img {
margin:10px 0 5px;
}
#ads img {
display:block;
padding-top:10px;
}
/* Header styles */
#header {
clear:both;
float:left;
width:80%;
}
#header {
border-bottom:1px solid #000;
}
#header p,
#header h1,
#header h2 {
padding:.4em 15px 0 15px;
margin:0;
}
#header a {
color:#E47AFF;
}
#header a:hover {
color:#fff;
background:#E47AFF;
text-decoration:none;
}
#header ul {
color: #FFFFFF;
float: right;
margin: 0 10% 0% 0%;
background: #E47AFF;
padding: 5px;
border-radius: 10px;
list-style: none;
position: relative;
display: inline-table;
overflow: visible;
}
#header ul li {
float: left;
}
#header ul li:hover {
background: #000;
color: #E47AFF;
position: relative;
}
#header ul li:active {
background: #FFFFFF;
}
#header ul li a {
display: block;
text-decoration: none;
color: #ffffff;
padding: 5px 20px;
display: inline;
}
#header ul:after {
content: "";
clear: both;
display: block;
}
#header ul ul {
display:none;
}
#header ul li:hover > ul {
display: block;
float: left;
}
#header ul ul {
background: #E47AFF;
border-radius: 10px;
padding: 5px;
position: absolute;
top: 100%;
}
#header ul ul li {
float: none;
position: relative;
top: 100%;
width: 125px;
}
#header ul ul li a {
padding: 5px 15px;
color: white;
width: 100px;
}
#links {
margin: 0 10% 0 10%;
}
/* 'widths' sub menu */
#layoutdims {
clear:both;
background:#eee;
border-top:4px solid #000;
margin:0;
padding:6px 15px !important;
text-align:right;
}
/* column container */
.colmask {
position:relative; /* This fixes the IE7 overflow hidden bug */
clear:both;
float:left;
width:80%; /* width of whole page */
overflow:hidden; /* This chops off any overhanging divs */
}
/* common column settings */
.colright,
.colmid,
.colleft {
float:left;
width:89%;
position:relative;
}
.col1,
.col2,
.col3 {
float:left;
position:relative;
padding:0 0 1em 0;
overflow:hidden;
}
/* 2 Column (right menu) settings */
.rightmenu {
background:#eee; /* right column background colour */
}
.rightmenu .colleft {
right:20%; /* right column width */
background:#fff; /* left column background colour */
}
.rightmenu .col1 {
width:74%; /* left column content width (left column width minus left and right padding) */
left:26%; /* (right column width) plus (left column left padding) */
}
.rightmenu .col2 {
width:25%; /* right column content width (right column width minus left and right padding) */
left:31%; /* (right column width) plus (left column left and right padding) plus (right column left padding) */
}
/* Footer styles */
#footer {
clear:both;
float:left;
width:80%;
border-top:1px solid #000;
}
#footer p {
padding:0 7% 0 7%;
margin:0;
}
这是HTML:
<!DOCTYPE html>
<html>
<head>
<title>Website.</title>
<link rel="stylesheet" type="text/css" href="screen.css" media="screen" />
</head>
<body>
<div id="page_wrap">
<div id="header">
<center><img src="berta.jpg"></center>
<div id="links">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="index.html">About</a></li>
<li><a href="index.html">Background</a></li>
<li><a href="index.html">Services</a>
<ul>
<li><a href="index.html">Example</a></li>
</ul>
</li>
<li><a href="index.html">Other</a></li>
<li><a href="index.html">Contact</a></li>
<li><a href="index.html">Disclaimer</a></li>
</ul>
</div>
</div>
<!-- <marquee bgcolor="#cccccc" loop="-1" scrollamount="5" width="100%">Welcome to the webpage of Berta Kay Celtic Reader.</marquee> -->
<div class="colmask rightmenu">
<div class="colleft">
<div class="col1">
<!-- Column 1 start -->
This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go. This is where your content will go.
<!-- Column 1 end -->
</div>
<div class="col2">
<!-- Column 2 start -->
<center><IMG src="roberta.jpg" width="200px"><br>
Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here. Any sidebar content will go here.
<!-- Column 2 end -->
</div>
</div>
</div>
<div id="footer">
<p>This page uses the <a href="http://matthewjamestaylor.com/blog/perfect-2-column-right-menu.htm">Perfect 'Right Menu' 2 Column Liquid Layout</a> by <a href="http://matthewjamestaylor.com">Matthew James Taylor</a>. View more <a href="http://matthewjamestaylor.com/blog/-website-layouts">website layouts</a> and <a href="http://matthewjamestaylor.com/blog/-web-design">web design articles</a>.</p>
</div>
</div>
</body>
</html>
请帮助!
最佳答案
的CSS
#d
{
z-index:100;
}
清单代码
<ul id='d'>
<li><a href="index.html">Example</a></li>
</ul>
如果我们手动设置z-index,则主体中所有元素的z-index:0都将位于顶部。
关于html - 下 zipper 接消失在网页的后面,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/24112871/