DIV CSS left right top bottom定位
来源:互联网 发布:单片机计时器原理 编辑:程序博客网 时间:2024/06/05 03:37
这四个CSS属性样式用于定位对象盒子,必须定义position属性值为absolute或者relative此取值方可生效。
一、语法结构 - TOP
Left、right、top、bottom后跟数字+html单位。
示范结构
div{left:20px}
div{right:20px}
div{top:20px}
div{bottom:20px}
Left 靠左距离多少
Right 靠右边距离多少
Top 距离顶部距离多少
Bottom距离下边距离多少
二、使用条件 - TOP
通常单独使用left、right、top、bottom均无效,需要在使用绝对定位CSS position样式才能生效。
一般left和right在一个样式是只能使用其一,不能left和right都设置,要么使用left就不使用right,要么使用right就不使用left,如果left和right均使用将会出现兼容问题,一个对象设置了靠左left多少距离,自然右边距离自然就有了所以无需设置左边。
相同道理,top和bottom对一个对象只能使用其一,不然会出现逻辑兼容问题。譬如一个人让你往左走,一个人让你往右走,同时发出往左往右走这个时候你也不好判断往那边走。
三、绝对定位中使用 - TOP
一般left、right、top、bottom使用于配合position定位对象位置。大家可以进入CSS position教程篇了解学习这些样式属性。
0 0
- DIV CSS left right top bottom定位
- DIV CSS left right top bottom定位
- left right top bottom定位div无效
- css left right top bottom定位
- css中absolute定位的top bottom left right
- css中的relative相对定位的top bottom left right
- 定位参数:position、left、right、top、bottom
- css属性left、right、top、bottom
- css之top,right,bottom,left
- css中定位position、偏移top,bottom,left,right和高宽度设置问题
- css定位position,absolute relative两种情况下,top,left,right,bottom的区别
- CSS中边偏移属性top,right,bottom,left
- css中的clip属性rect(top,right,bottom,left);
- margin: left right /top bottom的怪异
- clip:rect('top', 'right', 'bottom', 'left')
- View的位置--top, left, bottom, right
- glOrtho(left, right, bottom, top, near, far)
- html中 left,right,top,bottom图示
- android 开发中用到的代码总结(三)
- LeetCode——Unique Paths
- to_char函数对日期进行转换的格式
- ACM培训②
- Convert WebP to PNG using java
- DIV CSS left right top bottom定位
- 一个Sqrt函数引发的血案
- sql递归
- 在msys里进行复制和粘贴操作
- 不要试图用msvc来编译ffmpeg
- Mybatis封装分页查询的java公用类
- JQuery总结+实例
- 大型网站的架构设计图分享
- java qq号登陆第三方应用