今天的iframe实战练习
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>实战练习-后台小案例</title>
<style>
*{
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
body{
display: grid;
}
header{
width: 100%;
height: 160px;
background-color: aqua;
display: flex;
place-items: center;
}
header h1{
color: brown;
margin-left: 20px;
}
header section{
display: flex;
margin-left: auto;
}
header span{
margin-right: 20px;
}
header button{
margin-right: 20px;
}
nav{
background-color: rgb(235, 20, 20);
display: grid;
width: 15%;
text-align: center;
margin-top : 5px;
}
a{
text-decoration: none;
}
iframe{
margin-top: 5px;
width: 70%;
height: 100%;
background-color: rgb(142, 178, 245);
}
</style>
</head>
<body>
<!-- 后台顶部 -->
<header>
<h1>学生管理系统</h1>
<section>
<span>admin</span>
<button>退出</button>
</section>
</header>
<!-- 后台左侧 -->
<nav>
<a href="./表单-实战练习.html" target="content">登录页面</a>
<a href="实战-课程表.html" target="content">课程表</a>
<a href="./iframe+a.html" target="content">iframe练习</a>
<a href="./购物清单.html" target="content">购物清单</a>
<a href="" target="content">元素属性</a>
<a href="" target="content">元素属性</a>
<a href="" target="content">元素属性</a>
<a href="" target="content">元素属性</a>
</nav>
<!-- 后台右侧 -->
<iframe src="" frameborder="0" name="content" width="100%" height="100%"></iframe>
</body>
</html>
运行效果: