最终效果图:

html 代码:

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<title>项目实战 PC端固定布局</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<!-- body nav section 需要h1~h6标题大纲 div header不需要 -->
<header id="header">
<div class="center">
<!-- 一个页面最好就一个h1 让搜索引擎能更好的抓取关键字 -->
<h1 class="logo">旅行社</h1>
<nav class="link">
<h2 class="none">网站导航</h2>
<ul>
<li class="active"><a href="###">首页</a></li>
<li><a href="###">旅游咨询</a></li>
<li><a href="###">机票订购</a></li>
<li><a href="###">风景欣赏</a></li>
<li><a href="###">公司简介</a></li>
</ul>
</nav>
</div>
</header>
<div id="search">
<div class="center"></div>
<input type="text" class="search" placeholder="请输入想要去的景点">
<button class="button">搜索</button>
</div>
<div id="tour">
<section class="center">
<h2>热门旅游</h2>
<p>国内旅游,国外旅游,自助旅游,自驾旅游,游轮签证,主题游各种最新最热旅游推荐</p>
</section>
<!-- 图文并茂使用figure标签 -->
<!-- figcaption 进行图片说明 -->

<figure>
<img src="img/tour1.jpg" alt="热门旅游">
<figcaption><strong class="title">&lt;曼谷-芭提雅6日游&gt;</strong> 报团特惠,超丰富景点,升级一晚国五,无自费,赠送600元/成人资费卷</figcaption>
<div>
<em class="sat">满意度77%</em>
<span class="price">¥ <strong>2846</strong>起</span>
</div>
<div class="type">国内长线</div>
</figure>
    -----------------------后面重复----------------------
<figure>
<img src="img/tour2.jpg" alt="热门旅游">
<figcaption><strong class="title">&lt;曼谷-芭提雅6日游&gt;</strong> 报团特惠,超丰富景点,升级一晚国五,无自费,赠送600元/成人资费卷</figcaption>
<div>
<em class="sat">满意度77%</em>
<span class="price">¥ <strong>2846</strong>起</span>
</div>
<div class="type">国内长线</div>
</figure>
<figure>
<img src="img/tour3.jpg" alt="热门旅游">
<figcaption><strong class="title">&lt;曼谷-芭提雅6日游&gt;</strong> 报团特惠,超丰富景点,升级一晚国五,无自费,赠送600元/成人资费卷</figcaption>
<div>
<em class="sat">满意度77%</em>
<span class="price">¥ <strong>2846</strong>起</span>
</div>
<div class="type">国内长线</div>
</figure>
<figure>
<img src="img/tour4.jpg" alt="热门旅游">
<figcaption><strong class="title">&lt;曼谷-芭提雅6日游&gt;</strong> 报团特惠,超丰富景点,升级一晚国五,无自费,赠送600元/成人资费卷</figcaption>
<div>
<em class="sat">满意度77%</em>
<span class="price">¥ <strong>2846</strong>起</span>
</div>
<div class="type">国内长线</div>
</figure>
<figure>
<img src="img/tour5.jpg" alt="热门旅游">
<figcaption><strong class="title">&lt;曼谷-芭提雅6日游&gt;</strong> 报团特惠,超丰富景点,升级一晚国五,无自费,赠送600元/成人资费卷</figcaption>
<div>
<em class="sat">满意度77%</em>
<span class="price">¥ <strong>2846</strong>起</span>
</div>
<div class="type">国内长线</div>
</figure>
<figure>
<img src="img/tour6.jpg" alt="热门旅游">
<figcaption><strong class="title">&lt;曼谷-芭提雅6日游&gt;</strong> 报团特惠,超丰富景点,升级一晚国五,无自费,赠送600元/成人资费卷</figcaption>
<div>
<em class="sat">满意度77%</em>
<span class="price">¥ <strong>2846</strong>起</span>
</div>
<div class="type">国内长线</div>
</figure>
<figure>
<img src="img/tour7.jpg" alt="热门旅游">
<figcaption><strong class="title">&lt;曼谷-芭提雅6日游&gt;</strong> 报团特惠,超丰富景点,升级一晚国五,无自费,赠送600元/成人资费卷</figcaption>
<div>
<em class="sat">满意度77%</em>
<span class="price">¥ <strong>2846</strong>起</span>
</div>
<div class="type">国内长线</div>
</figure>
<figure>
<img src="img/tour8.jpg" alt="热门旅游">
<figcaption><strong class="title">&lt;曼谷-芭提雅6日游&gt;</strong> 报团特惠,超丰富景点,升级一晚国五,无自费,赠送600元/成人资费卷</figcaption>
<div>
<em class="sat">满意度77%</em>
<span class="price">¥ <strong>2846</strong>起</span>
</div>
<div class="type">国内长线</div>
</figure>
<figure>
<img src="img/tour9.jpg" alt="热门旅游">
<figcaption><strong class="title">&lt;曼谷-芭提雅6日游&gt;</strong> 报团特惠,超丰富景点,升级一晚国五,无自费,赠送600元/成人资费卷</figcaption>
<div>
<em class="sat">满意度77%</em>
<span class="price">¥ <strong>2846</strong>起</span>
</div>
<div class="type">国内长线</div>
</figure>
</div> <!--
<head>header</head>
<section>
<h2>bootstrap</h2>
<p>一个html5 标准框架</p>
</section>
<footer>footer</footer>
-->
</body>
</html>

CSS式样:

@charset "utf-8";

/*------------------------------------第一节 导航栏部分------------------------------------*/
/*本身外边距*/
body, h1, ul, h2, p, figure{
margin:;
padding:;
} /* 去除ul小圆点 */
ul {
list-style: outside none none;
} /* a 标签不需要下划线 */
a {
text-decoration: none;
} .none {
display: none;
} #header {
width: 100%;
min-width: 1263px;
height: 70px;
background: #333;
/*header做个阴影*/
box-shadow: 0 5px 10px rgba(0,0,0,0.3);
position: relative;
z-index:;
} #header .center {
width: 1263px;
height: 70px;
margin: 0 auto;
} #header .logo {
width: 240px;
height: 70px;
background-image: url(../img/logo.png);
/* h1中的字向左移动到不能看到 */
text-indent: -9999px;
float: left;
} #header .link {
width: 650px;
height: 70px;
float: right;
/* 字体淡灰 */
color: #eee;
/* 文字垂直居中 设定高度和 ul高度相同即可 */
line-height: 70px;
} #header .link li {
width: 120px;
/* li 文字横向铺平 */
float: left;
text-align: center;
} #header .link a {
color: #eee;
display: block;
} #header .link a:hover,
#header .active a {
background-color: #000;
} /*--------------------------------第二节 搜索框部分---------------------------------*/
/*search 搜索图片*/
#search {
width: 100%;
/*缩小页面滚动条右侧出现白色区域*/
min-width: 1263px;
height: 600px;
background: url(../img/search.jpg) no-repeat center;
position: relative;
} /*背景色div部分*/
#search .center {
width: 600px;
height: 60px;
background-color: #000;
position: absolute;
top: 50%;
left: 50%; /*上右下左*/
margin: -30px 0 0 -300px;
/*园边框*/
border-radius: 10px;
/*透明度*/
opacity: 0.6;
} /*input 输入框部分*/
#search .search {
width: 446px;
height: 54px;
background-color: #fff;
position: absolute;
top: 50%;
left: 50%;
/*上右下左*/
margin: -28px 0 0 -296px;
color: #666;
border: 1px solid #666;
border-radius: 10px;
font-size: 24px;
padding: 0 10px; /*处理某些浏览器点击后出现外边框*/
outline: none;
} /*搜索按钮部分*/
#search .button {
width: 120px;
height: 54px;
background-color: #fff;
position: absolute;
top: 50%;
left: 50%;
/*上右下左*/
margin: -28px 0 0 175px;
color: #666;
border: 1px solid #666;
border-radius: 10px;
font-size: 24px;
cursor: pointer;
/*处理某些浏览器点击后出现外边框*/
outline: none;
font-weight: bold;
}
/*---------------------------------第三节 旅游部分 -------------------------------------*/
#tour {
width: 1263px;
height: 1200px;
/*background-color: #ccc;*/
margin: 30px auto;
text-align: center;
} #tour .center h2 {
font-size: 45px;
/*字体间距*/
letter-spacing: 2px;
color: #666;
/*2参数 1为上下 2为左右*/
margin: 10px 0;
} #tour .center p {
color: #666;
margin: 10px 0;
} #tour figure {
border: 1px solid #ddd;
/*单独自己一块可以改变自身大小*/
display: inline-block;
padding: 4px;
border-radius: 4px;
margin: 15px 12px;
width: 380px;
text-align: left;
/*父元素相对定位 figure 子元素可以绝对定位*/
position: relative;
} /*图片居中*/
#tour figure img {
width: 380px;
height: 230px;
vertical-align: middle;
} #tour figure figcaption {
color: #777;
line-height: 1.5;
letter-spacing: 1px;
font-size: 14px;
/*上右下左*/
padding: 7px 0 5px 0;
} #tour .title {
color: #333;
font-weight: normal;
} #tour .sat {
float: right;
font-size: 13px;
color: #999;
font-style: normal;
position: relative;
top: 5px;
right: 5px;
} /*旅游产品价格*/
#tour .price {
color: #f60;
font-size: 14px;
}
#tour .price strong {
font-size: 20px;
letter-spacing: 1px;
} /*旅游产品种类 图片左上角角标*/
#tour .type {
width: 90px;
height: 25px;
line-height: 25px;
font-size: 14px;
/*绿色*/
background-color: #59b200;
color: white;
text-align: center;
position: absolute;
top: 4px;
left: 4px;
}

Html5 学习笔记 【PC固定布局】 实战3 热门旅游展示区的更多相关文章

  1. CSS学习笔记--Div+Css布局实战(入门)

    基本页面布局 本教程带着大家做一个简单的页面布局 最重效果如下: 1.第一部,先创建上下左右4个DIV <!DOCTYPE html> <html> <head lang ...

  2. [html5] 学习笔记-响应式布局

    1.响应式布局介绍 响应式布局是2010年5月份提出的一个概念,简而言之,就是一个网站能够兼容多个终端——而不是每一个终端做一个特定的版本.这个概念是为了兼容移动互联网浏览而诞生的,其目的是为用户提供 ...

  3. amazeui学习笔记--css(布局相关3)--辅助类Utility

    amazeui学习笔记--css(布局相关3)--辅助类Utility 一.总结 1.元素清除浮动: 添加 am-cf 这个 class 即可 2.水平滚动: .am-scrollable-horiz ...

  4. amazeui学习笔记--css(布局相关1)--网格Grid

    amazeui学习笔记--css(布局相关1)--网格Grid 一.总结 基本使用 1.div+class布局:amaze里面采取的就是div+class的布局方式  <div class=&q ...

  5. html5学习笔记一

    HTML5学习笔记 <video>标记:定义视频,Ogg.MPEG4.WebM三种格式 <video src=”movie.ogg”  controls=”controls”> ...

  6. 微信小程序开发:学习笔记[4]——样式布局

    微信小程序开发:学习笔记[4]——样式布局 Flex布局 新的布局方式 在小程序开发中,我们需要考虑各种尺寸终端设备上的适配.在传统网页开发,我们用的是盒模型,通过display:inline | b ...

  7. Html5学习笔记1 元素 标签 属性

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  8. amazeui学习笔记--css(布局相关2)--等分网格 AVG Grid

    amazeui学习笔记--css(布局相关2)--等分网格 AVG Grid 一.总结 1.与grid区别:网格中:am-g + am-u-xx-n 等分网格中只有一个: am-avg-sm-4(在u ...

  9. HTML5学习笔记之表格标签

    HTML5学习笔记之表格标签 其他HTML5相关文章 HTML5学习笔记之HTML5基本介绍 HTML5学习笔记之基础标签 HTML5学习笔记之表格标签 HTML5学习笔记之表单标签 HTML5学习笔 ...

随机推荐

  1. luoguP2123 皇后游戏(贪心)

    luoguP2123 皇后游戏(贪心) 题目 洛谷题目chuanso 题解 有一篇好题解,我就懒得推式子了,毕竟打到电脑上还是很难的 牛逼题解传送门 code #include<iostream ...

  2. Ajax爬取豆瓣电影目录(Python)

    下面的分析相当于一个框架,搞懂之后,对于类似的文字爬取,我们也可以实现.就算不能使用Ajax方法,我们也能够使用相同思想去爬取我们想要的数据. 豆瓣电影排行榜分析 网址:https://movie.d ...

  3. Activiti6.0 java项目框架 spring5 SSM 工作流引擎 审批流程

    工作流模块----------------------------------------------------------------------------------------------- ...

  4. openstack stein部署手册 2. 基础应用

    1. chrony # 安装程序包 yum install -y chrony # 变更配置文件 /etc/chrony.conf 增加 server 192.168.123.200 iburst # ...

  5. 04.Linux-CentOS系统SSH连接问题

    问题:SSH远程连接时报错 Socket error Event: 32 Error: 10053.Connection closing...Socket close.Connection close ...

  6. C# 生成word文档(NPOI.XWPF)

    一.基础 1.创建Word using NPOI.XWPF.UserModel XWPFDocument doc = new XWPFDocument(); //创建新的word文档 XWPFPara ...

  7. 六 BASH 高级变量

    高级变量分为三类 变量扩展 ${变量名}                  例   ${filename}   大括号 命令替换 $(命令) $(ls /) 小括号 算术扩展 $((算数式)) $(( ...

  8. hdu1210Eddy's 洗牌问题

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1210 Eddy是个ACMer,他不仅喜欢做ACM题,而且对于纸牌也有一定的研究,他在无聊时研究发现,如 ...

  9. grep正则 以.o结尾的文件

    ls -l | grep *.o 查不出任何东西 . 代表一定有一个任意字符 * 重复零个到无穷多个前一个字符(所以需要前面有字符) 所以应该是 ls -l | grep '.*\.o' .*表示零个 ...

  10. Linux 进程通信之:内存共享(Shared Memory)(转,好文章)

    https://blog.csdn.net/afei__/article/details/84188548