Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions echtiemell.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<link href="styles/file.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width" />


<title>taitou</title>
</head>
<body>
<p>My cat is <strong><em>very</em></strong> grumpy.</p>
<p>My cat is <em>very</em> grumpy.</p>
<p>My cat is <strong>very</strong> grumpy.</p>
<h1>??????????????</h1>
<h4>??????????????</h4>
<p>hggguysidjcapkwsoaipsdiocjapdovapdjicpadoicjapdoivjpaojidvapoidijisdpo,<br>.caspdcoasdjpapdfvojdfjjvajodviajraooijdfpao\ndjvpaodivjapdforivjapweidapodivofobipfdhbaifvhbauidfbakwebdjkadjvn</p>
<img src="image/tupian1.bmp" alt="?" />
<a href="https://developer.mozilla.org/">ddddddd</a>
<button>切换用户</button>

<script src="scripts/main.js" defer></script>
</body>
</html>
Binary file added image/tupian1.bmp
Binary file not shown.
Binary file added image/tupian2.bmp
Binary file not shown.
11 changes: 0 additions & 11 deletions index.html

This file was deleted.

26 changes: 26 additions & 0 deletions scripts/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
let myImage = document.querySelector("img");

myImage.onclick = function () {
let mySrc = myImage.getAttribute("src");
if (mySrc === "image/tupian1.bmp") {
myImage.setAttribute("src", "image/tupian2.bmp");
} else {
myImage.setAttribute("src", "image/tupian1.bmp");
}
};
let myButton = document.querySelector("button");
myButton.onclick = () => setUserName();

let myHeading = document.querySelector("h1");

function setUserName() {
let myName = prompt("你的名字是");
localStorage.setItem("name凄凄切切", myName);
myHeading.textContent = "哦," + myName;
}
if (!localStorage.getItem("name")) {
setUserName();
} else {
let storedName = localStorage.getItem("name");
myHeading.textContent = "?" + storedName;
}
46 changes: 46 additions & 0 deletions styles/file.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* 设置页面背景颜色和字体 */
body {
background-color: lightblue;
font-family: Arial, sans-serif;
}

/* 设置标题的颜色 */
h1 {
color: rgb(128, 105, 0);
text-align: center;
}

/* 设置段落的字体颜色和边距 */
p {
color: darkblue;
margin: 20px;
}
/* 设置链接的颜色和鼠标悬停效果 */
a {
color: rgb(71, 193, 93); /* 链接的颜色 */
text-decoration: none; /* 移除默认的下划线 */
}

a:hover {
color: red; /* 鼠标悬停时链接的颜色 */
}

/* 设置盒子模型的宽高和边框 */
div {
width: 300px; /* 盒子的宽度 */
height: 150px; /* 盒子的高度 */
border: 2px solid black; /* 盒子的边框颜色和宽度 */
padding: 10px; /* 内容与边框之间的内边距 */
margin: 20px; /* 盒子外部的外边距 */
background-color: lightgray; /* 盒子的背景颜色 */
}

/* 设置列表项的样式 */
ul {
list-style-type: square; /* 列表项的符号类型 */
}

ul {
color: rgb(255, 106, 0); /* 列表项的字体颜色 */
margin: 5px 0; /* 每个列表项之间的上下间距 */
}
47 changes: 0 additions & 47 deletions subwebpage.html

This file was deleted.