div+css实现响应式自适应后台仪表盘页面代码
代码语言:html
所属分类:响应式
代码描述:div+css实现响应式自适应后台仪表盘页面代码
代码标签: div css 响应式 自适应 后台 仪表盘 页面 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.4.0.css"> <style> @import url("https://fonts.googleapis.com/css2?family=Nunito:wght@200;300;400;500;600;700;800;900;1000&family=Roboto:wght@300;400;500;700&display=swap"); *, *::before, *::after { box-sizing: border-box; padding: 0; margin: 0; } nav { user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; } nav ul, nav ul li { outline: 0; } nav ul li a { text-decoration: none; } body { font-family: "Nunito", sans-serif; display: flex; align-items: center; justify-content: center; min-height: 100vh; background-image: url(//repo.bfw.wiki/bfwrepo/image/64bddc770add3.png); background-repeat: no-repeat; background-size: cover; /* background: #212140; */ } /* MAIN MENU */ main { display: grid; grid-template-columns: 13% 87%; min-height: 100vh; width: 100%; margin: 40px; background: rgb(254, 254, 254); box-shadow: 0 0.5px 0 1px rgba(255, 255, 255, 0.23) inset, 0 1px 0 0 rgba(255, 255, 255, 0.66) inset, 0 4px 16px rgba(0, 0, 0, 0.12); border-radius: 15px; z-index: 10; } .main-menu { overflow: hidden; background: rgb(73, 57, 113); padding-top: 10px; border-radius: 15px 0 0 15px; font-family: "Roboto", sans-serif; } .main-menu h1 { display: block; font-size: 1.5rem; font-weight: 500; text-align: center; margin: 20px 0 30px; color: #fff; font-family: "Nunito", sans-serif; } .logo { display: none; } .nav-item { position: relative; display: block; } .nav-item a { position: relative; display: flex; flex-direction: row; align-items: center; justify-content: center; color: #fff; font-size: 1rem; padding: 15px 0; margin-left: 10px; border-top-left-radius: 20px; border-bottom-left-radius: 20px; } .nav-item b:nth-child(1) { position: absolute; top: -15px; height: 15px; width: 100%; background: #fff; display: none; } .nav-item b:nth-child(1)::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-bottom-right-radius: 20px; background: rgb(73, 57, 113); } .nav-item b:nth-child(2) { position: absolute; bottom: -15px; height: 15px; width: 100%; background: #fff; display: none; } .nav-item b:nth-child(2)::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-top-right-radius: 20px; background: rgb(73, 57, 113); } .nav-item.active b:nth-child(1), .nav-item.active b:nth-child(2) { display: block; } .nav-item.active a { text-decoration: none; color: #000; background: rgb(254, 254, 254); } .nav-icon { width: 60px; height: 20px; font-size: 20px; text-align: center; } .nav-text { display: block; width: 120px; height: 20px; font-family: "Mulish", sans-serif; } /* CONTENT */ .content { display: grid; grid-template-columns: 75% 25%; } /* LEFT CONTENT */ .left-content { display: grid; grid-template-rows: 50% 50%; background: #f6f7fb; margin: 15px; padding: 20px; border-radius: 15px; } /* ACTIVITIES */ .activities h1 { margin: 0 0 20px; font-size: 1.4rem; font-weight: 700; } .activity-container { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(2, 150px); column-gap: 10px; } .img-one { grid-area: 1 / 1 / 2 / 2; } .img-two { grid-area: 2 / 1 / 3 / 2; } .img-three { display: block; grid-area: 1 / 2 / 3 / 4; } .img-four { grid-area: 1 / 4 / 2 / 5; } .img-five { grid-area: 1 / 5 / 2 / 6; } .img-six { display: block; grid-area: 2 / 4 / 3 / 6; } .image-container { position: relative; margin-bottom: 10px; box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 3px; border-radius: 10px; } .image-container img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; } .overlay { position: absolute; display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient( 180deg, transparent, transparent, rgba(3, 3, 185, 0.5) ); border-radius: 10px; transition: all 0.6s linear; } .image-container:hover .overlay { opacity: 0; } .overlay h3 { margin-bottom: 8px; margin-right: 10px; color: #fff; } /* LEFT BOTTOM */ .left-bottom { display: grid; grid-template-columns: 55% 40%; gap: 40px; } /* WEEKLY SCHEDULE */ .weekly-schedule { display: flex; flex-direction: column; } .weekly-schedule h1 { margin-top: 20px; font-size: 1.3rem; font-weight: 700; } .calendar { margin-top: 10px; } .day-and-activity { display: grid; grid-template-columns: 15% 60% 25%; align-items: center; border-radius: 14px; margin-bottom: 5px; color: #484d53; box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 3px; } .activity-one { background-color: rgb(124, 136, 224, 0.5); .........完整代码请登录后点击上方下载按钮下载查看
网友评论0