最终效果图:

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. 没有找到mspdb80.dll,因此这个应用程序未能启动...问题解决

    这里主要针对使用link.exe进行SIG文件制作时,报错. 首先下载,mspdb80.dll:https://www.lanzous.com/i59dgfi 将dll文件移动到我的电脑(32位)C: ...

  2. 【学习总结】gcc和gdb

    目录 <> vim.gcc.gdb: gcc: gcc和g++是c/c++的linux系统集成的编译器,源文件的后缀应为 .C/.cpp/.c++/.cc等 编译器可以将C.C++等语言源 ...

  3. Node.js 中监听 redis key 过期事件

    It is in fact possible to listen to the “expired” type keyevent notification using a subscribed clie ...

  4. worldcloud库的使用

    worldcloud库的使用 worldcloud是一个优秀的第三方词云展示库,用来实现比较有逼格的数据可视化效果.更加直观与艺术的展示单词. worldcloud对象的创建 worldcloud.W ...

  5. python关键字global和nonlocal总结

    函数中使用全局变量 a = 100 b = 200 def func(): def sub(): return b return a + b + sub() 执行fun()后返回值为:500 a, b ...

  6. standard_key.kmp

    [KeyRemap]keyVersion=2B33554467=[eraseeof]S36=[bof]B33554466=[pagedn]S35=[eof]B33554465=[pageup]B10= ...

  7. Mybatis-Generator demo

    使用Mybatis-Generator自动生成Dao.Model.Mapping相关文件(转) https://www.cnblogs.com/smileberry/p/4145872.html == ...

  8. vue之click事件绑定

    1.@click不光可以绑定方法,也可以就地修改data里的数据 代码示例代码如下: 2.@click绑定多个操作的时候用:隔开 代码示例代码如下: <el-table><el-ta ...

  9. MinMax 容斥 学习笔记

    基本形式 \[ \max(S) = \sum_{T\subseteq S, T \neq \varnothing} (-1)^{|T|-1}\min(T) \] 证明 不提供数学证明. 简要讲一下抽象 ...

  10. spring微服务(顺序由简入难易于理解)

    一.为微服务应用增加健康监控 1.在 build.gradle 文件 dependencies 属性中增加 compile('org.springframework.boot:spring-boot- ...