统一页头样式

This commit is contained in:
yangjian 2019-07-22 23:27:58 +08:00
parent 6c1619ab51
commit 2954311246
5 changed files with 132 additions and 18 deletions

Binary file not shown.

View File

@ -1,12 +1,40 @@
/* 页头下边框线 */
.layui-header{
border-bottom:1px solid #ddd;
}
/* 页头搜索框样式 */
.component{
position: absolute;
width: 250px;
left: 160px;
top: 10px;
}
/* 页头logo图片样式 */
.logo {
position: absolute;
left: 0;
left: 20px;
top: 16px;
}
.logo img {
/*width: 85px;*/
height: 30px;
}
/* 页头背景 */
.layui-nav{
background-color:transparent;
}
.layui-header .layui-nav{
position: absolute;
right: 0;
top: 0;
padding: 0;
}
.layui-nav .layui-nav-item a{
color:black;
}
.layui-nav .layui-nav-item a:hover{
color:black;
}
.project-list{
margin: 50px 0;
font-size: 0;

View File

@ -9,12 +9,43 @@
<link href="{% static 'style.css' %}" rel="stylesheet">
</head>
<body class="layui-layout-body">
<!--<div class="layui-row">-->
<!--<ul class="layui-nav layui-bg-blue">-->
<!--<li class="layui-nav-item"><a href="">MrDoc</a></li>-->
<!--<li class="layui-nav-item"><a href="/">回到首页</a></li>-->
<!--</ul>-->
<!--</div>-->
<div class="layui-header">
<div class="layui-main">
<a class="logo" href="{% url 'pro_list' %}">
<img src="/media/logo.png" />
</a>
<div class="component">
<div class="layui-input-inline">
<input class="layui-input" placeholder="搜索文集"/>
</div>
</div>
<ul class="layui-nav layui-layout-right">
{% if request.user.is_authenticated %}
<li class="layui-nav-item">
<a href="javascript:void(0);">
<i class="layui-icon layui-icon-username"></i> {{request.user.username}}
</a>
<dl class="layui-nav-child">
<!-- <dd><a href="">基本资料</a></dd> -->
<dd><a href="javascript:void(0);">修改密码</a></dd>
<dd><a href="{% url 'logout' %}">退出登录</a></dd>
</dl>
</li>
{% else %}
<li class="layui-nav-item">
<a href="javascript:void(0);">
<i class="layui-icon layui-icon-username"></i> 游客
</a>
<dl class="layui-nav-child">
<!-- <dd><a href="">基本资料</a></dd> -->
<dd><a href="javascript:void(0);">注册</a></dd>
<dd><a href="{% url 'login' %}">登录</a></dd>
</dl>
</li>
{% endif %}
</ul>
</div>
</div>
<div class="layui-main">
<div class="create-doc-form">
{# 文档标题#}

View File

@ -17,11 +17,42 @@
</style>
</head>
<body class="layui-layout-body">
<div class="layui-row">
<ul class="layui-nav layui-bg-blue">
<li class="layui-nav-item"><a href="">MrDoc</a></li>
<li class="layui-nav-item"><a href="/">回到首页</a></li>
</ul>
<div class="layui-header">
<div class="layui-main">
<a class="logo" href="{% url 'pro_list' %}">
<img src="/media/logo.png" />
</a>
<div class="component">
<div class="layui-input-inline">
<input class="layui-input" placeholder="搜索文集"/>
</div>
</div>
<ul class="layui-nav layui-layout-right">
{% if request.user.is_authenticated %}
<li class="layui-nav-item">
<a href="javascript:void(0);">
<i class="layui-icon layui-icon-username"></i> {{request.user.username}}
</a>
<dl class="layui-nav-child">
<!-- <dd><a href="">基本资料</a></dd> -->
<dd><a href="javascript:void(0);">修改密码</a></dd>
<dd><a href="{% url 'logout' %}">退出登录</a></dd>
</dl>
</li>
{% else %}
<li class="layui-nav-item">
<a href="javascript:void(0);">
<i class="layui-icon layui-icon-username"></i> 游客
</a>
<dl class="layui-nav-child">
<!-- <dd><a href="">基本资料</a></dd> -->
<dd><a href="javascript:void(0);">注册</a></dd>
<dd><a href="{% url 'login' %}">登录</a></dd>
</dl>
</li>
{% endif %}
</ul>
</div>
</div>
<div class="layui-main">
<div class="create-doc-form">

View File

@ -13,12 +13,36 @@
<a class="logo" href="{% url 'pro_list' %}">
<img src="/media/logo.png" />
</a>
{# <ul class="layui-nav layui-bg-blue" lay-filter="">#}
{# <li class="layui-nav-item"><a href="">MrDoc</a></li>#}
{# <li class="layui-nav-item layui-this"><a href="">产品</a></li>#}
{# <li class="layui-nav-item"><a href="">大数据</a></li>#}
{# <li class="layui-nav-item"><a href="">社区</a></li>#}
{# </ul>#}
<div class="component">
<div class="layui-input-inline">
<input class="layui-input" placeholder="搜索文集"/>
</div>
</div>
<ul class="layui-nav layui-layout-right">
{% if request.user.is_authenticated %}
<li class="layui-nav-item">
<a href="javascript:void(0);">
<i class="layui-icon layui-icon-username"></i> {{request.user.username}}
</a>
<dl class="layui-nav-child">
<!-- <dd><a href="">基本资料</a></dd> -->
<dd><a href="javascript:void(0);">修改密码</a></dd>
<dd><a href="{% url 'logout' %}">退出登录</a></dd>
</dl>
</li>
{% else %}
<li class="layui-nav-item">
<a href="javascript:void(0);">
<i class="layui-icon layui-icon-username"></i> 游客
</a>
<dl class="layui-nav-child">
<!-- <dd><a href="">基本资料</a></dd> -->
<dd><a href="javascript:void(0);">注册</a></dd>
<dd><a href="{% url 'login' %}">登录</a></dd>
</dl>
</li>
{% endif %}
</ul>
</div>
</div>
<div class="layui-main">