网页设计第17次课CSS定位属性介绍.ppt

  1. 1、本文档共61页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
当元素里内的内容超出所能容纳的范围时会自动溢出。 学完就练之7-2(请将源代码复制到页面中,开始练习): !--设置所有div向左浮动;前5个div的大小为100×160像素,背景色为黄色,有1像素实线黑色边框,底部外边距100像素。其中包含数字3的div设置溢出属性为隐藏;第6个div的大小为500×160像素,背景色为黄色,有1像素实线黑色边框,最后其他设置全部完成后清除其浮动。-- div人人人人人人人人人人人人人人人人人人人人人人人人司机人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人/div div人人人人人人人人人人人人人人人人人人人人人人人人人人人2人人人人人人人人人人人人人人人人人人人人人人人人人人人人人 人人人人人人人人人人人人人人人人人人人人人人人人人/div div class=div5人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人/div div人人人人人人人人人人人人人人人人人人人人人人人人人人人3人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人/div div人人人人人人人人人人人人人人人人人人人人人人人人人人人2人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人/div div人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人司机人人人人人人人人人人人人下一班人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人/div (7)可视区域属性 clip: 使用clip属性可以限定只显示裁切出的区域,裁切出的区域为矩形(必须将position的值设为absolute,此属性方可使用)。只要设置两个点即可,一个是矩形左上角的顶点,由top和left两项设置完成,另一个是右下角的顶点,由bottom和right两项设置完成(注,裁切的坐标是指元素自身的尺度,与position定位位置无关)。 【取值auto表示对象不裁切,是默认值。rect (数字)表示它依据上、右、下、左的顺序提供自对象左上角(0, 0)坐标计算的四个偏移数值,其中任一数值都可用auto替换,即此边不裁切。】 语法,clip : auto | rect(y1 x2 y2 x1) (8)可见属性 visibility: 该属性规定元素是否可见,即使不可见的元素也会占据页面上的空间。【取值visible表示元素是可见的,默认值。 hidden表示元素是不可见的。】 语法:visibility: visible 丨 hidden (9)框类型属性 display: display属性规定元素应该生成的框的类型,每一个网页元素都有一个默认的display属性值。如div的默认display属性值为“block”,称为“块级”元素;而span的默认display属性值为“inline”,称为“行内”元素。【取值none表示此元素不被显示;与visibility属性的hidden值不同,none不为被隐藏的对象保留其物理空间;block表示此元素将显示为块级元素,此元素前后会带有换行符;inline表示此元素会被显示为内联元素,元素前后没有换行符。】 语法,display: none丨block | inline 默认块级元素的显示方式是换行排列 改变它们的display属性后,块级元素被转换成了行内元素,因此显示方式变为不换行排列。 默认行内元素的显示方式是不换行排列 改变它们的display属性后,行内元素被转换成了块级元素,因此显示方式变为换行排列。 无论是行内元素还是块级元素,当它们的display属性被设置为none后,都会被隐藏且不会被保留宽度和高度空间。 注:visible:hidden属性会使对象不可见,但该对象在网页所占的空间没有改变(看不见但摸得到),等于留出了一块空白区域,而display:none属性会使这个对象彻底消失(看不见也摸不到)。 页面中

您可能关注的文档

文档评论(0)

502992 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档