标签:dde add 返回 char fixed meta pad -- icon
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>后台管理布局</title> <link rel="stylesheet" href="font-awesome-4.7.0/css/font-awesome.min.css"> <style> body{ margin: 0; } .pg-header{ height: 48px; background-color: #2459a2; color: white; line-height: 48px; /*高度居中*/ } .pg-header .icons{ padding: 0 20px; } .pg-header .icons:hover{ background-color: #204982; } .pg-header .logo{ width: 200px; background-color: cadetblue; text-align: center; /*font-size: 40px;*/ } .pg-header .user{ width: 50px; background-color: purple; text-align: center; line-height: 48px; /*font-size: 40px;*/ height: 48px; margin-top: 4px; margin-right: 60px; } .pg-header .user:hover{ background-color: #FF7F24; /*鼠标放上去能有不同颜色*/ } .pg-header .user .a img{ height: 40px; width: 40px; border-radius: 50% } .pg-header .user .b{ z-index:20; position:absolute; top: 30px; right: 0; color: red; width: 90px; display: none; } .pg-header .user:hover .b{ display: block; } .pg-header .user .b a{ display: block; } .pg-content .menu{ position: absolute; top: 48px; bottom: 0; left: 0; right: 0; width: 200px; background-color: #dddddd; } .pg-content .content{ position: absolute; top: 48px; right: 0; bottom: 0; left: 200px; background-color: lightgray; overflow: auto; min-width: 900px; z-index: 9; } .left{ float: left; } .right{ float: right; } </style> </head> <body> <div class="pg-header"> <div class="logo left"> 老男人 </div> <div class="user right" style="position: relative"> <a class="a" href=""> <img src="1.jpg"> <!--border-radius把图片变成圆的--> </a> <div class="b"> <a href="">我的资料</a> <a href="">注销</a> </div> </div> <div class="right icons"> <i class="fa fa-bell" aria-hidden="true"></i> </div> <div class="right icons"> <i class="fa fa-envelope" aria-hidden="true"></i> </div> </div> <div class="pg-content"> <div class="menu left">a</div> <div class="content right"> <p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p><p>adsad</p> <div style="width: 50px;height: 50px;bottom: 0;right: 0;position: fixed">返回顶部</div> </div> </div> <div class="pg-footer"></div> </body> </html>
line-height: 48px;
/*高度居中*/
:hover
悬浮显示
标签:dde add 返回 char fixed meta pad -- icon
原文地址:https://www.cnblogs.com/anhao-world/p/14221273.html