四、前端首页

4.1.导航条实现

(1)templates/new/index.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>知了课堂</title>
<link rel="stylesheet" href="../../dist/css/index.min.css">
<link rel="stylesheet" href="//at.alicdn.com/t/font_1239817_3xfonheuqlv.css">
</head>
<body>
<header class="header">
<div class="container"> <div class="logo-box">
<a href="/"></a>
</div> <ul class="nav">
<li class="active"><a href="/">资讯</a></li>
<li><a href="/">创业课堂</a></li>
<li><a href="/">企业服务</a></li>
<li><a href="/">搜索</a></li>
</ul> <div class="auth-box">
<i class="icon-person iconfont"></i>&nbsp;&nbsp
<a href="#">登录</a>
<a href="#">注册</a>
</div> </div>
</header>
</body>
</html>

阿里云图标网站:https://www.iconfont.cn/

搜索person-->>添加入库-->>添加至项目-->>编辑图标-->>放大-->>仅保存-->>查看在线链接

(2)src/css/init.scss

清除浏览器默认样式

html,body,h1,h2,h3,h4,h5,h6,div,dl,dt,dd,ul,ol,li,p,blockquote,pre,hr,figure,table,caption,th,td,form,fieldset,legend,input,button,textarea,menu{margin:;padding:;}
header,footer,section,article,aside,nav,hgroup,address,figure,figcaption,menu,details{display:block;}
table{border-collapse:collapse;border-spacing:;}
caption,th{text-align:left;font-weight:normal;}
html,body,fieldset,img,iframe,abbr{border:;}
i,cite,em,var,address,dfn{font-style:normal;}
[hidefocus],summary{outline:;}
li{list-style:none;}
h1,h2,h3,h4,h5,h6,small{font-size:100%;}
sup,sub{font-size:83%;}
pre,code,kbd,samp{font-family:inherit;}
q:before,q:after{content:none;}
textarea{overflow:auto;resize:none;}
label,summary{cursor:default;}
a,button{cursor:pointer;}
h1,h2,h3,h4,h5,h6,em,strong,b{font-weight:bold;}
del,ins,u,s,a,a:hover{text-decoration:none;}
body,textarea,input,button,select,keygen,legend{font:12px/1.14 arial,\5b8b\4f53;color:#333;outline:;}
body{background:#fff;}
a,a:hover{color:#333;}

(3)src/css/constants.scss

放一些常量

$pageWidth: 1170px

(3)src/css/index.scss

@import "init.scss";
@import "constants.scss"; .header{
width: 100%;
height: 64px;
background: #3a3a3a;
.container{
width: $pageWidth;
height: 100%;
margin: 0 auto;
overflow: hidden; .logo-box{
width: 140px;
height: 49px;
background: url("https://www.xfz.cn/static/build/images/logo.png") no-repeat;
margin-top: 8px;
float: left; a{
display: block;
width: 100%;
height: 100%;
}
} .nav{
margin-left: 128px;
float: left; li{
float: left;
margin-right: 40px;
line-height: 64px;
height: 64px;
box-sizing: border-box;
font-size: 22px;
a{
color: #fff;
} &.active{
border-bottom: 5px solid #5c87d9;
}
}
} .auth-box{
float: right;
line-height: 64px;
height: 64px;
color: #fff; .iconfont{
color: #fff;
font-size: 20px;
} a{
color: #fff;
font-size: 22px;
}
}
}
}

导航条效果

4.2.主题盒子布局

templates/news/index.html

<div class="main">
<div class="wrapper">
<div class="news-wrapper"></div>
<div class="sidebar-wrapper"></div> </div> </div>

src/css/index.scss

.main{
width: 100%;
margin-top: 84px; .wrapper{
width: $pageWidth;
margin: 0 auto;
background: green;
height: 1000px;
overflow: hidden; .news-wrapper{
float: left;
width: 798px;
height: 500px;
background: yellowgreen;
} .sidebar-wrapper{
float: right;
width: 356px;
height: 500px;
background: deeppink;
}
}
}

固定导航条

src/css/index.scss

.header{
width: 100%;
height: 64px;
background: #3a3a3a;
position: fixed;
left:;
right:;
top:;

效果

Django打造大型企业官网(三)的更多相关文章

  1. 超细讲解Django打造大型企业官网

    本文为知了课堂黄勇老师讲的<超细讲解Django打造大型企业官网>的笔记. 第一章 Django预热 1.创建virtualenv虚拟环境 2.URL组成部分详解 3.Django介绍 4 ...

  2. Django打造大型企业官网

    第1章 Django预热 1-为什么需要虚拟环境 2-virtualenv创建虚拟环境 3-virtualenvwrapper使用 4-URL组成部分讲解 5-课程准备工作 6-Django介绍 第2 ...

  3. Django打造大型企业官网(二)

    三.项目环境搭建 3.1.创建项目环境和安装包 创建django项目 mkvirtualenv DjangoProject workon DjangoProject pip install -i ht ...

  4. Django打造大型企业官网(八)

    4.16.侧边栏标题和广告位布局完成 templates/news/index.html <div class="sidebar-wrapper"> <div c ...

  5. Django打造大型企业官网(七)

    4.13.新闻列表tab栏布局完成 templates/news/index.html <div class="list-outer-group"> <ul cl ...

  6. Django打造大型企业官网(六)

    4.9.根据轮播图个数修改小圆点数量 src/js/index.js function Banner() { this.bannerWidth = 798; } Banner.prototype.in ...

  7. Django打造大型企业官网(五)

    4.6.切换轮播图的箭头样式以及显示和隐藏 templates/news/index.html <span class="arrow left-arrow">‹< ...

  8. Django打造大型企业官网(四)

    4.3.轮播图布局和样式 templates/news/index.html <div class="news-wrapper"> <div class=&quo ...

  9. Django打造大型企业官网(一)

    一.nvm的安装 (1)下载:nvm1.16 (2)安装完成后添加环境变量 C:\Users\Administrator\AppData\Roaming\nvm (3)修改settings.txt,将 ...

随机推荐

  1. mysql-scott用户的表的创建

    /* 功能:创建 scott 数据库中的 dept 表 */ create table dept( deptno int unsigned auto_increment primary key COM ...

  2. clusterdb - 对一个PostgreSQL数据库进行建簇

    SYNOPSIS clusterdb [ connection-option...] [ --table | -t table] [ dbname] clusterdb [ connection-op ...

  3. C++中何时使用引用

    使用引用参数的原因: 程序员能够修改调用函数中的数据对象 通过传递引用而不是整个数据对象,可以提高程序的运行速度. 当数据对象较大时(如结构和类对象),第二个原因最重要,这些也是使用指针参数的原因.这 ...

  4. 对散列进行sort排序,只是会产生一个顺序,但这顺序和初始化时的顺序不一致

    109 my $slice_layouts;    110 my $vertical_assignment;    111 my %map_function_indices = (    112    ...

  5. 无法完成安装:'Cannot access storage file '/

    今天自己编译了spice-protocol spice-gtk spice qemu,然后想用virsh去创建一个虚机: # virsh define demo.xml     定义域 demo(从 ...

  6. 显微镜下的webpack4入门

    前端的构建打包工具很多,比如grunt,gulp.相信这两者大家应该是耳熟能详的,上手相对简单,而且所需手敲的代码都是比较简单的.然后webpack的出现,让这两者打包工具都有点失宠了.webpack ...

  7. [GXOI/GZOI2019]宝牌一大堆(dp)

    luogu     bzoj 这个麻将题还算挺友善的,比隔壁zjoi的要好得多... 比较正常的做法是五维dp 但事实上六维dp也是完全不会被卡的 七对子选权值最高的七个,国士无双直接$13^2$暴力 ...

  8. [LUOGU] P1113 杂物

    题目描述 John的农场在给奶牛挤奶前有很多杂务要完成,每一项杂务都需要一定的时间来完成它.比如:他们要将奶牛集合起来,将他们赶进牛棚,为奶牛清洗乳房以及一些其它工作.尽早将所有杂务完成是必要的,因为 ...

  9. action类中属性驱动和模型驱动的区别

    1.Struts2的属性驱动 在Action类中,属性××通过get××()和set××()方法,把参数在整个生命周期内进行传递,这就是属性驱动 代码如下: package org.abu.csdn. ...

  10. php与mysql事物处理

    PHP与MYSQL事务处理 mysql事物特性 (原子性,一致性,隔离性,持久性) /*MYSQL的事务处理主要有两种方法.1.用begin,rollback,commit来实现begin 开始一个事 ...