版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Basics of Web DesignChapter 7Page Layout BasicsKey Concepts1Copyright 2016 Pearson Education, Inc., Hoboken NJLearning esConfigure float Configure fixed positioning Configure relative positioningConfigure absolute positioning Create two-column page layouts Configure vertical navigation in an unorder
2、ed listConfigure horizontal navigation in an unordered list.Add interactivity to hyperlinks with CSS pseudo-classesConfigure CSS sprites2Copyright 2016 Pearson Education, Inc., Hoboken NJNormal FlowBrowser display of elements in the order they are coded in the Web page documentFigure 7.1Figure 7.2Co
3、pyright 2016 Pearson Education, Inc., Hoboken NJ3float PropertyElements that seem to “float on the right or left side of either the browser window or another element are often configured using the CSS float property.4h1 background-color: #A8C682; padding: 5px; color: #000000; p font-family: Arial, s
4、ans-serif; #yls float: right; margin: 0 0 5px 5px; border: solid; Copyright 2016 Pearson Education, Inc., Hoboken NJclear PropertyUseful to “clear” or terminate a floatValues are left, right, and bothThe h2 text is displayed in normal flow.clear: left; was applied to the h2. Now the h2 text displays
5、 AFTER the floated image.Copyright 2016 Pearson Education, Inc., Hoboken NJ5overflow PropertyConfigures the display of elements on a web page. Useful to “clear” or terminate a float before the end of a container elementValues are auto, hidden, and scrollThe background does not extend as far as youd
6、expect.overflow: auto; was applied to the container div.Now the background extends and the h2 text displays AFTER the floated image.Copyright 2016 Pearson Education, Inc., Hoboken NJ6Basic Two-Column Layout Copyright 2016 Pearson Education, Inc., Hoboken NJ7Basic Two-Column Layout#wrapper width: 80%
7、; margin-left: auto; margin-right: auto; background-color: #EAEAEA; header background-color: #CCCCFF; h1 margin: 0; padding: 10px; nav float: left; width: 150px; padding: 10px; main margin-left: 160px; padding: 10px; background-color: #FFFFFF; footer text-align: center; font-style: italic; backgroun
8、d-color: #CCCCFF; Copyright 2016 Pearson Education, Inc., Hoboken NJ8Vertrical Navigation with an Unordered Listnav Home Menu Directions ContactCSS removes the list marker and underline:nav ul list-style-type: none; nav a text-decoration: none; 9Copyright 2016 Pearson Education, Inc., Hoboken NJdisp
9、lay PropertyConfigures how and if an element is displayed display: none;The element will not be displayed.display: block;The element is rendered as a block element even if it is actually an inline element, such as a hyperlink.display: inline;The element will be rendered as an inline element even if
10、it is actually a block element such as a .10Copyright 2016 Pearson Education, Inc., Hoboken NJHorizontal Navigation with an Unordered ListHTML:nav Home Menu Directions ContactCSS removes the list marker, removes the underline, adds padding, and configures the list items for inline display.nav ul lis
11、t-style-type: none;nav a text-decoration: none; padding-right: 10px; nav li display: inline; 11Copyright 2016 Pearson Education, Inc., Hoboken NJCSS Pseudo-classesPseudo-classes and the anchor element:link default state for a hyperlink :visited a hyperlink that has been visited:focus triggered when
12、the hyperlink has focus:hover triggered whenthe mouse moves over the hyperlink:active triggered when the hyperlink is being clicked a:link color:#000066; a:visited color:#003366; a:focus color:#FF0000; a:hover color:#0099CC; a:active color:#FF0000;Copyright 2016 Pearson Education, Inc., Hoboken NJ12
13、CSSPseudo-classesa:link color: #ff0000; a:hover text-decoration: none; color: #000066; 13Copyright 2016 Pearson Education, Inc., Hoboken NJPosition Property14Copyright 2016 Pearson Education, Inc., Hoboken NJFixed Positioningnav position: fixed; 15Copyright 2016 Pearson Education, Inc., Hoboken NJRe
14、lative PositioningChanges the location of an element in relation to where it would otherwise appear in normal flow16p position: relative; left: 30px; font-family: Arial, sans-serif; Copyright 2016 Pearson Education, Inc., Hoboken NJAbsolute PositioningPrecisely specifies the location of an element o
15、utside of normal flowin in relation to its first parent non-static element17p position: absolute; left: 200px; top: 100px; font-family: Arial, sans-serif; width: 300px; Copyright 2016 Pearson Education, Inc., Hoboken NJCSS SpritesSpritean image file that contains multiple small graphicsadvantage: sa
16、ves download time18Copyright 2016 Pearson Education, Inc., Hoboken NJCSS Debugging TipsManually check syntax errorsUse W3C CSS Validator to check syntax errors Configure temporary background colorsConfigure temporary bordersUse CSS comments to find the unexpected/* the browser ignores this code */Dont expect your pages to look exactly the same in all browsers!Be patient!19Copyright 2016 Pearson Education, Inc., Hoboken NJSummaryThis chapter expanded your CSS skillset.You configured web pages with floating elements with CSS.You were introduced to fixed, relative, and absolute positioning.You c
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年广东省广州市中考语文真题(含答案)
- 2026中国绿发中绿可胜公司招聘6人备考题库及答案详解(基础+提升)
- 2026北京大兴区第二批事业单位招聘教师146人备考题库附答案详解(夺分金卷)
- 2026广东惠州市惠城区中医医院第二批编外人员招聘7人备考题库附答案详解(考试直接用)
- 2026浙江宁波市北仑区郭巨街道招聘编外人员1人考试模拟试题及答案解析
- 2026江西省国有企业党的建设研究会招聘1人备考题库及答案详解(名校卷)
- 2026安徽安庆市安汇港务有限公司招聘项目制外包人员2人考试参考题库及答案解析
- 2026年中国宠物经济全产业链现状与2028年趋势研判
- 2026江西汉普医疗科技有限公司招聘备考题库完整参考答案详解
- 2026四川成都市安逸酒店集团有限责任公司招聘1人备考题库附答案详解(综合题)
- 甘肃卷2024年高考真题化学试题(含答案)
- 高速收费员入职前培训
- 拆除工程施工组织设计模板专业版
- 六年级上册《多彩的活动》写作指导+例文分析
- 电子病历管理制度和工作方案
- DB35T 1585-2021 电梯使用管理单位安全管理规则
- 国开(内蒙古)2024年《创新创业教育基础》形考任务1-3终考任务答案
- 《机床数控技术 第4版》课件全套 李郝林 第1-9章 概述、数控加工程序编制 -自由曲线及曲面的加工
- 三年级数学下册计算题大全(每日一练共40份)
- 降低ICU患者压力性损伤发生率汇报课件
- 《基本乐理》课件-第五课 和弦
评论
0/150
提交评论