Skip to content

Commit 5b52f82

Browse files
committed
修改div_id数字为card数字,部分fixed改成absolute
1 parent cff3dea commit 5b52f82

2 files changed

Lines changed: 17 additions & 18 deletions

File tree

‎Styles/index.css‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,8 @@ body{
1717
justify-content: center;
1818
align-items: center;
1919
}
20-
#div_id3{
21-
margin-top: 240px;
22-
margin-left: 480px;
23-
}
24-
#div_id2{
25-
margin-top: 240px;
26-
margin-left: 160px;
27-
}
28-
#div_id4{
29-
margin-top: 240px;
30-
margin-left: 800px;
31-
}
3220
.div_class1{
33-
position: fixed;
21+
position: absolute;
3422
transform: translate(-50%,-50%);
3523
background-color: white;
3624
width: 300px;
@@ -42,6 +30,18 @@ body{
4230
.div_class1:hover{
4331
border-color: rgb(0, 255, 242)
4432
}
33+
#card1{
34+
top: 250px;
35+
left: 170px;
36+
}
37+
#card2{
38+
top: 250px;
39+
left: 490px;
40+
}
41+
#card3{
42+
top: 250px;
43+
left: 810px;
44+
}
4545
#text1{
4646
color: white;
4747
font-weight: 200;

‎index.html‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,24 @@
88
<body>
99
<div id="div_id1">
1010
<h1 id="text1">有CSS和无CSS的区别</h1>
11-
</div>
12-
<div class="div_class1" id="div_id2">
11+
<div class="div_class1" id="card1">
1312
<h1 class="text2">登录页对比</h1>
1413
<p class="text3">对比有CSS和无CSS的登录页</p>
1514
<button class="btnClass1 btn1" onclick="window.location.href='./NoAndWith-HTML/Login/Login_NoCSS.html'">查看无CSS页面</button>
1615
<button class="btnClass1 btn2" onclick="window.location.href='./NoAndWith-HTML/Login/Login_WithCSS.html'">查看有CSS页面</button>
1716
</div>
18-
<div class="div_class1" id="div_id3">
17+
<div class="div_class1" id="card2">
1918
<h1 class="text2">Hello World对比</h1>
2019
<p class="text3">对比有CSS和无CSS的Hello World演示页</p>
2120
<button class="btnClass1 btn1" onclick="window.location.href='./NoAndWith-HTML/Hello-World/HelloWorld_NoCSS.html'">查看无CSS页面</button>
2221
<button class="btnClass1 btn2" onclick="window.location.href='./NoAndWith-HTML/Hello-World/HelloWorld_WithCSS.html'">查看有CSS页面</button>
2322
</div>
24-
<div class="div_class1" id="div_id4">
23+
<div class="div_class1" id="card3">
2524
<h1 class="text2">Blog页对比</h1>
2625
<p class="text3">对比有CSS的博客页和无CSS的博客页</p>
2726
<button class="btnClass1 btn1" onclick="window.location.href='./NoAndWith-HTML/Blog-Page/Blog_NoCSS.html'">查看无CSS界面</button>
2827
<button class="btnClass1 btn2" onclick="window.location.href='./NoAndWith-HTML/Blog-Page/Blog_WithCSS.html'">查看有CSS界面</button>
29-
</div>
28+
</div>>
3029
<script>
3130
document.addEventListener("contextmenu",(NoCtm) => {
3231
NoCtm.preventDefault();

0 commit comments

Comments
 (0)