From 4f0ed2b446b2137bec174e5c52f34e3e74388155 Mon Sep 17 00:00:00 2001 From: zhilv Date: Tue, 11 Nov 2025 09:54:38 +0800 Subject: [PATCH] =?UTF-8?q?add(web.test4):=20=E6=96=B0=E5=A2=9E=20web=20?= =?UTF-8?q?=E8=AF=BE=E5=AE=9E=E9=AA=8C=E5=9B=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/README.md | 3 +- Web/test4/index.html | 41 ++++++++++++++++++++++++ Web/test4/public/mainMenu.css | 59 +++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 Web/test4/index.html create mode 100644 Web/test4/public/mainMenu.css diff --git a/Web/README.md b/Web/README.md index 14c9702..c2132ff 100644 --- a/Web/README.md +++ b/Web/README.md @@ -14,5 +14,6 @@ ├── images # 图片资源 ├── test1 # 实验一 ├── test2 # 实验二 -└── test3 # 实验三 +├── test3 # 实验三 +└── test4 # 实验四 ``` diff --git a/Web/test4/index.html b/Web/test4/index.html new file mode 100644 index 0000000..442b63e --- /dev/null +++ b/Web/test4/index.html @@ -0,0 +1,41 @@ + + + + + + + + 主页 + + + + + + + \ No newline at end of file diff --git a/Web/test4/public/mainMenu.css b/Web/test4/public/mainMenu.css new file mode 100644 index 0000000..9fcb9e9 --- /dev/null +++ b/Web/test4/public/mainMenu.css @@ -0,0 +1,59 @@ +* { + margin: 0; + padding: 0; + font-size: 24px; + box-sizing: border-box; +} + +ul li { + list-style: none; +} + +.sub-menu { + display: none; +} + +ul > li:hover .sub-menu { + display: block; +} + +a { + text-decoration: none; + color: inherit; +} + +.main-menu li { + background: #c22fef; + color: aliceblue; + border-radius: 2px; + text-align: center; +} + +.main-menu > li { + width: 200px; + border: 1px solid #77049a; + margin: 1px 3px; +} + +li:hover { + background: #a93aca; +} + +div { + border: 15px solid red; + border-bottom-color: transparent; + border-left-color: transparent; + border-right-color: transparent; + display: inline-block; + position: absolute; + right: 2px; + opacity: 0; +} + +.main-menu li { + position: relative; +} + +ul > li:hover div { + opacity: 1; +}