WEB前端静态网页(div+css)

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

前言

提示::前端开发初学者,之前从事石油天然气设计行业


⛵ 源码获取 文末联系 ✈`

一、静态网页主要运用的技术

1、HTML:HTML是最基础的技术,用于定义页面的结构和内容。它包含了页面的主要元素,如标题、段落、列表、超链接、图像等等。
2、CSS:CSS用于控制页面的风格和布局。它可以控制字体、颜色、大小和页面的排版,使你的页面看起来更美观、高效、专业。

二、使用步骤

1.CSS代码(包括base.css/index.css)

代码如下(示例):

base.css/* 基础公共样式 清楚默认样式 设置通用样式 */

*{
   
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

li{
   
    list-style: none;
}

body{
   
    font: 14px/1.5 "Microsoft Yahei","Hiragino Sans GB","hEITI Sc", sans-serif;
}

a{
   
    color: #333;
    text-decoration: none;
}
index.css
/* 首页css样式 */
/* 版心居中 */
.wrapper{
   
    margin: 0 auto;
    width: 1200px;
}

body{
   
    background: #f3f5f7;
}

/* 头部区域 */
.header{
   
    height: 100px;
    background-color: white;
}

.header .wrapper{
   
    padding-top: 29px;
    display: flex;
}

/* logo */
.logo a{
   
    display: block;
    width: 195px;
    height: 41px;
    background-image: url(../images/logo.png);
    font-size: 0;
}

/* 导航 */
.nav{
   
    padding-left: 102px;
}

.nav ul{
   
    display: flex;
}

.nav li {
   
    margin-right: 24px;
}

.nav li a{
   
    display: block;
    padding: 6px 8px;
    line-height: 27px; 
    font-size: 19px;
}

/* acitve 类选择器 表示默认选中的a */
.nav li .active,
.nav li a:hover{
   
    border-bottom: 2px solid #00a4ff;    
}

/* 搜索 */
.search{
   
    display: flex;
    margin-left: 62px;
    padding-left: 19px;
    padding-right: 12px;
    width: 412px;
    height: 40px;
    background-color: #f3f5f7;
    border-radius: 20px;
}

.search input{
   
    flex: 1;
    border: 0;
    background-color: transparent;
    /* 去掉表单控件的焦点框 */
    outline: none;
}

/* ::placeholder 选中就是placeholder属性文字样式 */
.search input::placeholder{
   
    font-size: 14px;
    color: #999;
}

.search a{
   
    align-self: center;
    width: 50px;
    height: 40px;
    background-image: url(../images/btn.png);
}


/* 用户 */
.user{
   
    margin-left: 32px;
    margin-top: 4px;
}


.user img{
   
    margin-right: 7px;
    /* vertical-align 行内快和行内垂直方向对齐方式 */
    vertical-align: middle;
}

.user span{
   
    font-size: 16px;
    color: #666;
}

/* banner 区域 */
.banner{
   
    height: 420px;
    background-color: #0092cb;
}

.banner .wrapper{
   
    display: flex;
    justify-content: space-between;
    height: 420px;
    background-image: url(../images/banner2.png);
}

/* 测导航 */
.banner .left{
   
    padding: 3px 20px;
    width: 191px;
    height: 420px;
    background-color: #000;
    opacity: 0.42;
}

.banner .left a{
   
    display: block;
    height: 46px;
    background-image: url() no-repeat;
    line-height:42px;
    font-size: 16px;
    color: white;
}

.banner .left a:hover{
   
    color: #00a4ff;
}

/* 课程表 */
.banner .right{
   
    margin-top: 60px;
    border-radius: 10px;
    width: 218px;
    height: 305px;
    background-color: #209dd5;
}

.banner .right h3{
   
    margin-left: 14px;
    height: 48px;
    line-height: 48px;
    font-size: 15px;
    font-weight: 400;
    color: #fff;
}

.banner .right .content{
   
    padding: 14px;
    height: 257px;
    background-color: #fff;
    border-radius: 10px;
}

.banner .right dl{
   
    margin-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.banner .right dt{
   
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 700;
}

.banner .right dd{
   
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 16px;
}

.banner .right dd span{
   
    color: #00a4ff;
}

.banner .right dd strong{
   
    color: #7b7b7b;
    font-weight: 400;
}

.banner .right a{
   
    display: block;
    height: 32px;
    background-color: #00a4ff;
    text-align: center;
    line-height: 32px;
    font-size: 14px;
    color: #fff;
    border-radius: 15px;
}

/* 精品推荐 */
.recommend{
   
    display: flex;
    margin-top: 12px;
    padding: 0px 20px;
    height: 60px;
    background-color: #fff;
    box-shadow: 0px 1px 2px 0px rgba(211, 211, 211, 0.5);
    line-height: 60px;
}

.recommend h3{
   
    font-size: 18px;
    color: #00a4ff;
    font-weight: 400;
}

.recommend ul{
   
    /* 除去标题和需改数据的尺寸 父级剩余尺寸都给了ul 实现吧修改兴趣挤到最右边 */
    flex: 1;
    display: flex;
}

.recommend ul li a{
   
    padding: 0 24px;
    border-right: 1px solid #e0e0e0;
    font-size: 18px;
}

.recommend ul  li:last-child a{
   
    border-right: 0;
}

.recommend .modify{
   
    font-size: 16px;
    color: #00a4ff;
}

/* 精品推荐课程 */
.course{
   
    margin-top: 15px;
}

/* 标题 公共类 与其他区域公用 */
.hd{
   
    display: flex;
    justify-content: space-between;
    height: 60px;
    line-height: 60px;
}

.hd h3{
   
    font-size: 21px;
    font-weight: 400;
}

.hd .more {
   
    font-size: 14px;
    color: #999;
}

/* 课程内容 */
.bd ul{
   
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.bd li{
   
    margin-bottom: 14px;
    width: 228px;
    height: 271px;
    background-color: pink;
}

.bd li .pic{
   
    height: 156px;
}

.bd li .text{
   
    padding: 20px;
    height: 115px;
    background-color: #fff;
}

.bd li .text h4{
   
    margin-bottom: 13px;
    height: 40px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
}

.bd li .text p{
   
    font-size: 14px;
    line-height: 20px;
    color: #999;
}

.bd li .text p span{
   
    color: #fa6408;
}

.bd li .text p i{
   
    font-style: normal;
}

/* 前端 */
.hd ul{
   
    display: flex;
}

.hd li{
   
    margin-left: 60px;
    font-size: 14px;
}

.hd li .active{
   
    color: #00a4ff;
}

.bd{
   
    display: flex;
    justify-content: space-between;
}

.bd .left{
   
    width: 228px;
    background-color: pink;
}

.bd .right{
   
    width: 957px;
    background-color: pink;
}

.bd .right .top{
   
    margin-bottom: 15px;
    height: 100px;
}

.footer{
   
    margin-top: 60px;
    padding-top: 60px;
    height: 273px;
    background-color: #fff;
}

.footer .wrapper{
   
    display: flex;
    justify-content: space-between;
}

.footer .left{
   
    width: 440px;
    /* background-color: pink; */
}

.footer .left P{
   
    margin-top: 24px;
    margin-bottom: 14px;
    font-size: 12px;
    line-height: 17px;
    color: #666;
}

.footer .left .download{
   
    display: block;
    width: 120px;
    height: 36px;
    border: 1px solid #00a4ff;
    text-align: center;
    line-height: 34px;
    font-size: 16px;
    color: #00a4ff;
}

.footer .right{
   
    display: flex;
}

.footer .right dl{
   
    margin-right: 130px;
}

.footer .right dt{
   
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 23px;
}

.footer .right a{
   
    font-size: 14px;
    color: #666;
    line-height: 24px;
}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学成在线</title>
    <!-- 先清除在设置 -->
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/index.css"
  • 1
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值