qfedu-web/www/index.html

170 lines
4.2 KiB
HTML
Raw Permalink Normal View History

2023-09-14 12:03:17 +08:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
2023-09-18 11:21:50 +08:00
<title>弹性盒子</title>
<style>
html,
body {
height: 100%; /* 100%的高度 */
margin: 0; /* 边距 */
padding: 0; /* 内边距 */
}
body {
display: flex;
flex-direction: column;
justify-content: space-between;
}
#top,
#footer {
/* height: 70px; 高度 */
background-color: lightblue;
}
#main {
height: 100%; /* 100%的高度 */
display: flex;
flex-direction: row;
}
#top {
display: flex; /* 弹性盒子 */
flex-direction: row; /* 水平排列 */
justify-content: space-between; /* 水平分布 */
justify-items: center; /* 水平居中 */
align-items: center; /* 垂直居中 */
padding: 5px;
border-bottom: 1px solid firebrick;
}
#logo > img {
width: 50px;
height: 50px;
box-shadow: 0 0 10px 5px #fff;
border-radius: 50%;
}
#logo:hover > img {
position: absolute;
width: 100px;
height: 100px;
box-shadow: 0 0 20px 10px lightskyblue;
border-radius: 50%;
}
#footer {
height: 35px; /* 高度 */
border-top: 1px solid lightgray;
border-color: firebrick;
padding: 5px 0;
}
#menu {
width: 300px;
border-right: 1px solid lightgray;
margin: 20px;
}
iframe {
outline: none;
border: none;
}
#menu ul,
#menu li {
list-style: none;
padding: 0;
margin: 0;
}
#menu li {
margin: 10px 0; /* 上下间距为10px 左右不需要 */
/* overflow: hidden; 超出部分隐藏 */
}
#menu a {
display: block; /* 块级元素 */
text-decoration: none; /* 去掉下划线 */
color: black; /* 字体颜色 */
padding: 10px 20px; /* 上下10px 左右20px */
width: 80%; /* 宽度80% */
}
#menu a:hover {
/* 鼠标悬停 */
color: red; /* 字体颜色 */
background-color: aquamarine;
border-radius: 5px; /* 圆角 */
border-top-right-radius: 30px;
border-bottom-right-radius: 30px;
}
</style>
2023-09-14 12:03:17 +08:00
</head>
2023-09-18 11:21:50 +08:00
2023-09-14 12:03:17 +08:00
<body>
2023-09-18 11:21:50 +08:00
<div id="top">
<div id="logo">
<img src="./images/google-2.ico" alt="logo" />
</div>
<div id="user_info">
登录用户 <span id="userName"></span
><span class="logout" onclick="logout()">登出</span>
</div>
</div>
<div id="main">
<div id="menu">
<ul class="menu-list">
<h3>自定义样式</h3>
<li class="menu-item">
<a href="css1.html" target="content_frame">css1</a>
</li>
<li class="menu-item">
<a href="css2.html" target="content_frame">css2</a>
</li>
<li class="menu-item">
<a href="css4.html" target="content_frame">图片列表</a>
</li>
<h3>Form标签</h3>
<li class="menu-item">
<a href="form1.html" target="content_frame">form1</a>
</li>
<li class="menu-item">
<a href="form2.html" target="content_frame">form2</a>
</li>
<li class="menu-item">
<a href="form3.html" target="content_frame">form3</a>
</li>
</ul>
</div>
<div id="content" style="width: 100%">
<iframe name="content_frame" width="100%" height="100%"> </iframe>
</div>
</div>
<div id="footer" style="text-align: center">
<b>版权所有© 福来科瀚</b><br />
<i>Flykhan: 000111010</i>
</div>
<script>
window.onload = function () {
// 验证当前浏览器用户是否已经登录
if (localStorage.getItem("login_user") == null) {
open("/login.html", "_self");
} else {
let login_user_str = localStorage.getItem("login_user");
let login_user = JSON.parse(login_user_str);
userName.innerText = login_user.nickName;
}
};
function logout() {
localStorage.clear();
open("/login.html", "_self");
}
</script>
2023-09-14 12:03:17 +08:00
</body>
</html>