关于div与div嵌套的问题

zzq2980 2014-08-07 04:44:20
这是我的代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
</style>
<link rel="stylesheet" href="../style_css/cgal_1.css"/>
</head>

<body>
<!--头文件开始-->
<div class="top">
<div class="top_1_1">
<a href="">
<p class="sz" align="center">设置主页</p></a>
</div>
<div class="top_1_2">
<a href="">
<p class="sz_1" align="center">点击收藏</p></a>
</div>
</div>
<div id="header">
<div class="top_1">
</div>

</div>
<!--头部结束-->
</body>
</html>
css
/*头文件开始*/
.top{
width:1280px;
height:24px;

margin:0 auto;
background:url(../images/top1.jpg)
}
.top_1_1{
height:24px;
width:74px;
margin-left:1002px;
position:relative;
}
.top_1_2{
width:74px;
height:24px;
margin-left:1096px;
float:left;


}
.sz{
font-size:12px;
color:#FFFFFF;
padding-top:5px;

}
.sz_1{
font-size:12px;
color:#000;
padding-top:5px;
}


#header{
width:1280px;
height:105px;
border:1px solid #F00;
margin:0 auto;
position:relative;
background:#F2F2F2;

}
#header .top_1 {


width:362px;
height:32px;
margin:0 auto;
margin-top:19px;

background:url(../images/cgal_1.png) -426px -19px no-repeat;
}

/*头文件结束*/
问题是“点击收藏这几个字不显示”
本人新手 求大神指教啊
...全文
162 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
zzq2980 2014-08-08
  • 打赏
  • 举报
回复
引用 9 楼 fdipzone 的回复:
[quote=引用 8 楼 zzq2980 的回复:] [quote=引用 6 楼 qq1219990906 的回复:] 应该是错位了->
怎么修改啊??????????????????[/quote] 2樓不是已經給出答案了嗎[/quote]
引用 9 楼 fdipzone 的回复:
[quote=引用 8 楼 zzq2980 的回复:] [quote=引用 6 楼 qq1219990906 的回复:] 应该是错位了->
怎么修改啊??????????????????[/quote] 2樓不是已經給出答案了嗎[/quote] 3Q
傲雪星枫 2014-08-08
  • 打赏
  • 举报
回复
引用 8 楼 zzq2980 的回复:
[quote=引用 6 楼 qq1219990906 的回复:] 应该是错位了->
怎么修改啊??????????????????[/quote] 2樓不是已經給出答案了嗎
zzq2980 2014-08-08
  • 打赏
  • 举报
回复
引用 6 楼 qq1219990906 的回复:
应该是错位了->
怎么修改啊??????????????????
zzq2980 2014-08-08
  • 打赏
  • 举报
回复
引用 4 楼 fdipzone 的回复:
[quote=引用 3 楼 xuzuning 的回复:] 你的语言声明是 charset=utf-8 但你的程序文件并没有保存为 utf-8 的 所以虽然显示了,你却看不见
我看到的是錯位了[/quote] 恩错位了 , 怎么修改啊???
小透明张三 2014-08-07
  • 打赏
  • 举报
回复
应该是错位了->
辛星 2014-08-07
  • 打赏
  • 举报
回复
引用 3 楼 xuzuning 的回复:
你的语言声明是 charset=utf-8 但你的程序文件并没有保存为 utf-8 的 所以虽然显示了,你却看不见
有道理
傲雪星枫 2014-08-07
  • 打赏
  • 举报
回复
引用 3 楼 xuzuning 的回复:
你的语言声明是 charset=utf-8 但你的程序文件并没有保存为 utf-8 的 所以虽然显示了,你却看不见
我看到的是錯位了
xuzuning 2014-08-07
  • 打赏
  • 举报
回复
你的语言声明是 charset=utf-8 但你的程序文件并没有保存为 utf-8 的 所以虽然显示了,你却看不见
傲雪星枫 2014-08-07
  • 打赏
  • 举报
回复

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
/*头文件开始*/
.top{
width:1280px;
height:24px;

margin:0 auto;
background:url(../images/top1.jpg)

}

.top p{
	margin:0px;
}

.top_1_1{
height:24px;
width:74px;
margin-left:1002px;
float:left;
}
.top_1_2{
width:74px;
height:24px;
float:left;
}
.sz{
font-size:12px;
color:#FFFFFF;
padding-top:5px;

}
.sz_1{
font-size:12px;
color:#000;
padding-top:5px;
}


#header{
width:1280px;
height:105px;
border:1px solid #F00;
margin:0 auto;
position:relative;
background:#F2F2F2;

}
#header .top_1 {


width:362px;
height:32px;
margin:0 auto;
margin-top:19px;

background:url(../images/cgal_1.png) -426px -19px no-repeat;
}

/*头文件结束*/
</style>
</head>
  
<body>
<!--头文件开始-->
     <div class="top">
       <div class="top_1_1">
      <a href="">
      <p class="sz" align="center">设置主页</p></a>
      </div>
      <div class="top_1_2">
      <a href="">
      <p class="sz_1" align="center">点击收藏</p></a>
   </div>
   </div>
     <div id="header">
     <div class="top_1">
     </div>
     
     </div>
<!--头部结束-->
</body>
</html>
zzq2980 2014-08-07
  • 打赏
  • 举报
回复
急急急!!!!!!!急急急!!!!!!!!!!

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧