English 中文(简体)
我怎么把iv放在另一个 d头上?
原标题:How do I place a div on top of another div?
  • 时间:2011-09-14 23:55:30
  •  标签:
  • html
  • css

我基本上想到的是,如果出现重叠,在任何时候都把一个集中的图像(“射线”四)放在前列。

这部法律:

body {
background-image:url( background.jpg );
}

#container {
width: 1040px;
height: 768px;
margin: 0 0 0 75px;
}


#navbar {
float: right;
height: auto;
width: 150px;
margin: 0 0 0 10px;
color: #FF0;
list-style: none;

}


#note {
width: auto;
height: auto;
float: left;
margin: 20px 0 0 -110px;

}


#drob {
height: auto;
width: auto;
float: left;
margin: 50px 0 0 -20px;

}


#gallery {
float: left;
width: 675px;
height: auto;
margin: -125px 0 0 -20px;

}


#gallery img {
float: left;
margin: 0 0 0 5px;  

}


#video {
height: auto;
width: auto;
float: left;
margin: 150px 0 0 -20px;

}


<div id="container">
<div id="navbar">
    <ul>
        <li>Home</li>
        <li>About Denard</li>
        <li>Stats</li>
        <li>Media</li>
    </ul>
</div>
<div id="video">
<iframe width="450" height="265" src="http://www.youtube.com/embed/ZmmCAI8U_Vc" 
frameborder="0" allowfullscreen></iframe>
</div>
<div id="drob">
<img src="images/drob.png" height="560" width="404" alt="Denard Robinson" />
</div>
<div id="note">
    <a href="#"><img src="images/note.png" height="464" width="331" alt="note" /></a>
</div>
<div id="gallery">
    <img src="denard1.jpg" height="145" width="215" alt="denard1" />
    <img src="denard2.jpg" height="145" width="215" alt="denard2" />
    <img src="denard3.jpg" height="145" width="215" alt="denard3" />
</div>

</div>    


</body>
问题回答

你们需要确定你重叠的z子。

低z指数的四端将落后于高指数。

可在

只要主食有选择,你就可以把事情放在首位,只增加一个z-指数。 但是,在本案中,你有一席之地,可能利用绝对位置把一人放在首位。 就像:

#drob {
height: auto;
width: auto;
float: left;
margin: 50px 0 0 -20px;
position: absolute;
}

或可能会尝试两种,即z-index和立场......,因为我认为z-index在位置上做的是:

#drob {
height: auto;
width: auto;
float: left;
margin: 50px 0 0 -20px;
position: absolute;
z-index: 5;
}

或许可以工作





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签