我试图将#box1 定位在#table1 下,我尝试移动它,但它没有移动。我究竟做错了什么。我是 CSS 新手。
编辑:我把我的html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Assignment 1</title>
<meta charset="utf-8">
<style>
html{
background: #afc2df;
}
#box1{
position fixed;
border: 120px;
border-style: groove;
border-radius:35px;
width: 505px;
length: 75px;
margin-left: 85px;
z-index: 5;
}
this is the table I want to move
#table1{
position fixed;
background: #00FFFF;
margin-left: 118px;
top: 160px;
z-index: 6;
}
</style>
</head>
<body>
<b></b><h1><b><i><font face="impact" color="red">Name</font> </i></b></h1>
<b></b><h2><b><i><font face="impact" color="red">Number</font> </i></b></h2>
<table border="3" id="table1">
<tbody><tr>
<th colspan="2">WEB PAGE ELEMENTS</th>
</tr>
<tr>
<th>Html</th>
<td><font face="Candara" color="black">Marks beginning and ending of a web page (closing tags needed)</font></td>
</tr>
<tr>
<th>Head</th>
<td><font face="Candara" color="black">Used to enclose elements not apart of the main page (closing tags needed)</font></td>
</tr>
<tr>
<th>Title</th>
<td><font face="Candara" color="black">Included in the <head> section, appears in the title bar of the browser (closing tags needed)</font></td>
</tr>
<tr>
<th>Body</th>
<td><font face="Candara" color="black">Includes content that is visible in the browser (closing tag needed)</font></td>
</tr>
<tr>
<th>Meta</th>
<td><font face="Candara" color="black">Allows passage of information about the page to user agents(self-closing tag)</font></td>
</tr>
</tbody></table>
<div id="box1"></div>
</div>
</body>
</html>
这是 CSS 和我的 html。
我真的很想在这方面做得很好,并感谢您的帮助。