<!DOCTYPE html>
<html>
<html>
<head>
<title>Preview Slideshow</title>
<meta charset="utf-8">
<style type="text/css">
*{padding :0; margin: 0;}
body{
padding: 50px 0;
background-color: #FFF;
font-size: 14px;
font-family:'Avenir Next';
color :#555;
-webkit-font-smoothing:antialiased; /*字体抗锯齿*/
}
.slider .main .main-i,
.slider .main,
.slider{
width:100%;
height: 400px;
position: relative;
}
/*幻灯片区域*/
.slider .main{
overflow: hidden;
}
/*每一个幻灯片的样式*/
.slider .main .main-i{}
.slider .main .main-i img{
width: 100%;
position: absolute;
left: 0;
top: 0;
}
.slider .main .main-i .caption{
position: absolute;
right:50%;
top: 30%;
}
.slider .main .main-i .caption h2{}
.slider .main .main-i .caption h3{}
/*控制按钮区域*/
.slider .ctrl{}
</style>
</head>
<body>
<div>
<div>
<div>
<div>
<h2>h2 caption</h2>
<h3>h3 caption</h3>
</div>
<img src="images/1.jpg" />
</div>
</div>
<div>
<a href= "javascipt:;"><img src="images/1.jpg" /></a>
</div>
</div>
</body>
</html>
这个是我的代码,我想把h2和h3的标题的div caption 在img的上面,可是绝对定位不好使
现在我的问题不是这个,而是我写的代码在<style></style>中好像根本就不能控制body里的caption的div,我也不知道为什么,求大神帮帮我好么
袁偉