Blogger Information
Blog 12
fans 1
comment 0
visits 9798
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
内外边距的实际应用、相对和绝对定位、浮动0705
简简单单的博客
Original
823 people have browsed it

浏览器默认:图片水平和垂直平铺,x和y方向。

设置不平铺:no repeat

图片背景定位:background-position:lefe center;20%,50%

背景滚动条滚动:background-attachment:scroll,fixed固定

两张图片用逗号隔开

简写:background:yellow url(../images/bg1.jpg) no-repeat left center fixed

图片居中有三种方式

<img src="../css/.01.jpg" alt="" width="200" height:="300">

外边距

margin同级塌陷:小的会陷入到大的里面去,小的会陷入大的里面去,以大的为准。只有上下,没有左右塌陷。

margin:50px;auto

嵌套传递:

文档流:

脱离文档流:从浏览器的脱离,这是布局的前提,就两个手段,第一个就是浮动,第二个就是绝对定位,可以脱离文档流

元素是自由的,由用户说了算。

不受左右浮动影响:clear=left

相对定位:没有脱离文档流,案例:相对定位十字架。

绝对定位:脱离了

固定定位:就是固定了

1.静态定位: 浏览器默认方式, 即文档流中的位置

2.相对定位: 元素并未脱离文档流,只是相对于它原来的位置,做相对移动

3.绝对定位: 元素脱离文档流重新排列,不论元素之前是什么类型,全部转为块元素,支持宽高

4.固定定位: 始终相对于浏览器的窗口做为定位父级,进行定位


 


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!