菜鸟,求解释!求帮助!

lyz12600 2012-09-10 04:25:21
<!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=gb2312" />
<title>首页</title>
<link href="c.css" rel="stylesheet" type="text/css" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
</head>

<body>
<div id="container">
<div id="header">
<div id="logo">
<img src="../图片/folder_web.png" width="150" height="150"></img>
</div>

<div id="lable">
<span id="c" class="style1">c</span>
<span id="l" class="style1">l</span>
<span id="o" class="style1">o</span>
<span id="u" class="style1">u</span>
<span id="d" class="style1">d</span>
</div>

<div id="simple">
<table>
<tr>
<td width="20%" align="center">用户名</td>
<td align="left"><input type="text" name="username" size="20"></td>
<td width="40%" align="left"><input type="checkbox" name="auto" id="auto_login">
<font class="style2">自动登录</font></td>
</tr>
<tr>
<td width="20%" align="center">密码</td>
<td align="left"><input type="password" name="password" size="20"></td>
<td align="left"><input type="submit" name="submit" value="登录"></td>
</tr>
<tr>
<td></td>
<td align="center"><a href="www.baidu.com"><font class="style2">找回密码</font></a></td>
<td align="left"><a href="www.baidu.com"><font class="style2">注册</font></a></td>
</tr>
</table>
</div>
</div>

<div id="navbar">
</div>

<div id="research">
</div>

<div id="primary">
</div>

<div id="magic">
</div>

<div id="footer">
</div>
</div>
</body>
</html>


下面是css部分:

/* CSS Document */
body{
background-color:#E0EEE0;
}
#container{
width:900px;
height:800px;
margin:0px auto;
background-color:#EBEBEB;
}

#header{
width:100%;
height:150px;
background-color:#CFCFCF;
}

#logo{
width:150px;
height:150px;
float:left;
} <!--标记部分,图片logo-->

#lable{
width:350px;
height:150px;
float:left;
}

.style1{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:100px;
letter-spacing:2px;
}

#c{ color:#0033FF;}
#l{ color:#99CC00;}
#o{ color:#FF9900;}
#u{ color:#CC0000;}
#d{ color:#FF00CC;}
<!--网站名设置-->
#simple{
background-color:#99FF99;
height:150px;
position:absolute;
top:0px;
left:570px;
margin:0px;
}

#navbar{
background-color:#D8BFD8;
width:100%;
height:50px;
}

#research{
background-color:#EEEE00;
width:100%;
height:80px;
}

#primary{
background-color:#BFEFFF;
width:50%;
height:450px;
float:left;
}

#magic{
background:#C6E2FF;
width:50%;
height:450px;
float:right;
}

#footer{
background-color:#9999CC;
width:100%;
height:100px;
clear:both;
}

这个是我暂时分出来的布局,可是我想把登录界面放在右上角,明明放在simple中了,可是为什么总是位置偏移,求指导!
...全文
209 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
小草草草哟 2012-09-21
  • 打赏
  • 举报
回复
浮动定位,标签记得成对写,别多或者少写
__phoenix 2012-09-19
  • 打赏
  • 举报
回复
css定义中加上float:left
例如:
#label {float:left;width:xx}
#simple {float:left;width:xx}
只要width之和不大于页面的宽度,就可以并排显示了。
未知数 2012-09-10
  • 打赏
  • 举报
回复
唉 csdn真的该升升级了,显示回复成功却老是看不到
再写一次吧

div默认要占一行
这句改一下就行了
<div id="lable" style="float:left;">
未知数 2012-09-10
  • 打赏
  • 举报
回复
div默认是要占一行的
这儿略改一下就可以了
<div id="lable" style="float:left;">
flysun03 2012-09-10
  • 打赏
  • 举报
回复
用绝对定位试试


还有<div id="footer">
</div>
</div>
两个是什么意思?

61,129

社区成员

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

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