div+css布局实现顶部导航条消息通知点击下拉显示消息列表效果代码

代码语言:html

所属分类:菜单导航

代码描述:div+css布局实现顶部导航条消息通知点击下拉显示消息列表效果代码

代码标签: div css 顶部 导航条 消息 通知 点击 下拉 显示 消息 列表

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  
  
  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Oxygen:wght@700&family=Work+Sans:wght@300;500&display=swap");
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: "Work Sans", sans-serif !important;
	background-color: #f2f8ff;
	color: #333;
}

.header {
	padding: 1rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #fff;
	position: fixed;
	width: calc(100% - 250px);
	top: 0;
	left: 250px;
	z-index: 1000;
	min-height: 70px;
	box-shadow: 0 5px 20px -17px rgba(0, 0, 0, 0.34);
}

.sidebar {
	max-height: 70px;
	background: #030110;
	height: 100vh;
	position: fixed;
	width: 250px;
}

.bell-con {
	color: #030110;
}

.notification-icon {
	display: flex;
	position: relative;
	cursor: pointer;
	justify-content: center;
	align-items: center;
	background: rgba(0, 0, 0, 0.03);
	padding: 10px;
	border-radius: 60%;
}

.notification-tray {
	display: none;
	position: absolute;
	right: 20px;
	top: 90px;
	background-color: #fff;
	box-shadow: 0 5px 20px -17px rgba(0, 0, 0, 0.34);
	width: 300px;
	max-height: 350px;
	z-index: 100;
	overflow-y: auto;
}

.notification-header {
	padding: 10px;
	background: rgb(221 232 243);
}

.notification-item {
	padding: 10px;
	display: flex;
	align-items: center;
	gap: 5px;
	border-bottom: 1px solid #eee;
	cursor: pointer;
}

box-icon {
	margin-left: 5px;
}

.notification-content {
	margin-left: 10px;
}

.notification-title {
	font-size: 10px;
	font-weight: bold;
	text-transform: uppercase;
	margin-bottom: 5px;
	color: #030110;
}

.notification-description {
	font-size: 12px;
	color: #787781;
}

.pulse {
	display: none;
	position: absolute;
	top: -1px;
	right: -2px;
	width: 13px;
	height: 13px;
	background-color: red;
	border-radius: 50%;
	border: 2px solid white;
	animation: pulse 2s infinite ease-in;
}

@keyframes pulse {
	0% {
		transform: scale(0.75);
		opacity: 0.5;
	}
	50% {
		transform: scale(1);
		opacity: 1;
	}
	100% {
		transform: scale(0.75);
		opacity: 0.5;
	}
}

#notificationCount:not(:empty) ~ .pulse {
	display: block;
}

#logo {
	margin-left: 7.5%;
}

.search-input {
	margin-left: 30px;
	border: none;
	outline: none;
	width: 100%;
	padding: 5px;
	font-size: 13px;
}

.footer {
	position: fixed;
	bottom: 10px;
	right: 10px;
	color: black;
	font-size: 12px;
	text-align: right;
	font-family: monospace;
}

.footer a {
	color: black;
	text-decoration: none;
}
</s.........完整代码请登录后点击上方下载按钮下载查看

网友评论0