1. 制作一个在线QQ客服的固定定位(QQ客服用图片就行);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
#image {
position: fixed;
top: 5rem;
left: 10rem;
width: 10px;
height: 150px;
}
</style>
</head>
<body>
<div id="image">
<img src="./12.PNG" >
</div>
2. 仿课堂案例写一个三行三列的定位布局, 色块或边框代表内容就可以;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-size: 16px;
}
header,footer {
height: 5em;
background-color: darkseagreen;
}
.container {
position: relative;
width: 1200px;
height: 500px;
margin: 0 auto;
}
.container aside:first-of-type {
position: absolute;
left: 0;
top: 0;
width: 320px;
height: 500px;
background-color: royalblue;
}
.container aside:last-of-type {
position: absolute;
right: 0;
top: 0;
width: 320px;
height: 500px;
background-color: royalblue;
}
.container main {
position: absolute;
left: 320px;
top: 0;
width: 560px;
height: 500px;
background-color: rosybrown;
}
</style>
</head>
<body>
<header>页眉</header>
<div class="container">
<aside>内容1</aside>
<main>内容</main>
<aside>内容2</aside>
</div>
<footer>页脚</footer>
</body>
</html>