css四中定位总结备忘_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:44:19
Original
1240 people have browsed it

css布局的核心是position属性,position:static || relative || absolute || fixed


static是默认的属性


相对定位:

相对定位相对的是它原来在文档中的位置(或者默认位置)。接下来,可以使用top、right、bottom、left属性来改变它的位置。


绝对定位三特性:

1.设置成绝对定位后默认的宽度变成内容宽度

2.设置成绝对定位的部分脱离文档流

3.绝对定位的默认参照物为第一定位祖先/根元素


固定定位:

固定定位元素的上下文是视窗,它不会随页面的滚动而移动。固定定位并不常用,最常见的情况是用它创建不随页面滚动而移动的导航元素。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!