<!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>
<!-- <head>header</head>
<section>
<h2>bootstrap</h2>
<p>一个html5 标准框架</p>
</section>
<footer>footer</footer> -->
</body>
</html>

css文件:

@charset "utf-8";

/*------------------------------------第一节导航栏部分------------------------------------*/
/*本身外边距*/
body, h1, ul {
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;
}

Html5 学习笔记 【PC固定布局】 实战2 导航栏搜索区域的更多相关文章

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

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

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

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

  3. Bootstrap学习笔记(8)--响应式导航栏

    说明: 1. 响应式导航栏,就是右上角的三道杠,点一下下方出现隐藏的导航栏.如果屏幕够大就显示所有的导航选项,如果屏幕小比如手机,就显示部分,剩下的放到三道杠里隐藏. 2. 外面套一个大的div,其实 ...

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

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

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

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

  6. html5学习笔记一

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

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

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

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

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

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

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

随机推荐

  1. 解决Linux下Svn检出Windows SVN服务器上项目SSL handshake failed: SSL error: Key usage violation in certificate has been detected.

    在Linux上检出windows SVN服务器上项目时出现了SSL handshake failed: SSL error: Key usage violation in certificate ha ...

  2. 微信、QQ、新浪微博等第三方登录,你想知道的都在这了(上) 微信、QQ、新浪微博等第三方登录,你想知道的都在这了(下)

    微信.QQ.新浪微博等第三方登录,你想知道的都在这了(上):https://www.jianshu.com/p/133d84042483 微信.QQ.新浪微博等第三方登录,你想知道的都在这了(下):h ...

  3. call,apply,bind的用法和细节差异

    call,apply,bind的用法 call,apply和bind都用来改变js中this对象的指向 var dog = { name:'dog', speak: function(value){ ...

  4. 洛谷 P1589 泥泞路 & 2019青岛市竞赛(贪心)

    题目链接 https://www.luogu.org/problemnew/show/P1589 解题思路 用结构体存下每一段泥泞路的左端点和右端点,然后用sort根据左端点排序,采用贪心的思想,从左 ...

  5. hive Hsql

    show databases; use flume; show tables; desc flume; alter table table_name add columns(dt string); a ...

  6. github命令大全

    github是一种开源的版本控制工具,现在已经得到很多人的应用.所以想介绍一下github的一些使用. github安装 github提供了桌面客户端,我们也可以通过命令行的方式来进行控制. wind ...

  7. http响应代码解释

    200:成功响应 302:找到,但是请求的资源在另外一个不同的url中. 400:错误请求.这个请求不能被服务器所理解,客户端必须修改请求. 401:未认证,这个请求需要用户认证. 404:未找到.服 ...

  8. ASE Alpha Sprint - backend scrum 4

    本次scrum于2019.11.8再sky garden进行,持续10分钟. 参与人: Zhikai Chen, Jia Ning, Hao Wang 请假: Xin Kang, Lihao Ran, ...

  9. Spring STS 开发IDE下载安装

    https://spring.io/tools https://spring.io/tools3/sts/all/ Spring STS,全称是SpringSource Tool Suite ,是由s ...

  10. 自己关于SSM框架的搭建

    第一步 导入相应的包 spring springmvc 需要的包 spring-webmvc spring-aop spring-beans apring-context spring-core sp ...