CSS-定位 | <position>
位置坐标由一个或两个关键字指定,并带有可选的偏移量。每个关键字(left,right,top,bottom,或center)表示任一元件的盒子的边缘或两个边缘之间的中心线上。根据上下文,center表示左边缘和右边缘之间的中心,或者表示顶边和底边之间的中心。
如果指定,偏移量可以是相对<percentage>值或绝对值<length>。正值向右或向下偏移,以适当值为准。负值在相反的方向上偏移。
如果只指定一个关键字或偏移量,则它定义x坐标; 另一个轴的值被假定为center。
内插值
横坐标和纵坐标都是独立插值的。由于速度由<timing-function>两者定义,点将沿直线移动。
值
/* 1-value syntax */ keyword /* Either the horizontal or vertical position; the other axis defaults to center */ <length> or <percentage> /* The position on the x-axis; the y-axis defaults to 50% */ /* 2-value syntax */ keyword keyword /* A keyword for each direction (the order is irrelevant) */ keyword value /* The value is the offset for the edge defined by the keyword */
正式语法
[ [ left | center | right | top | bottom | <percentage> | <length> ] | [ left | center | right | <percentage> | <length> ] [ top | center | bottom | <percentage> | <length> ] | [ center | [ left | right ] [ <percentage> | <length> ]? ] && [ center | [ top | bottom ] [ <percentage> | <length> ]? ] ]
规范
|
Specification |
Status |
Comment |
|---|---|---|
|
CSS Values and Units Module Level 3The definition of '<position>' in that specification. |
Candidate Recommendation |
Relists links to both definitions with the requirement to be coherent: if CSS Backgrounds and Borders Module Level 3 is supported, its definition of <position> must be used too. |
|
CSS Backgrounds and Borders Module Level 3The definition of '<position>' in that specification. |
Candidate Recommendation |
Defines <position> explicitly and extends it to support offsets from any edge. |
|
CSS Level 2 (Revision 1)The definition of '<position>' in that specification. |
Recommendation |
Allows combination of a keyword with a <length>, or <percentage> value. |
|
CSS Level 1The definition of '<position>' in that specification. |
Recommendation |
Defines <position> anonymously as the value of background-position. |
浏览器兼容性
|
Feature |
Chrome |
Edge |
Firefox (Gecko) |
Internet Explorer |
Opera |
Safari |
|---|---|---|---|---|---|---|
|
Basic support |
1.0 |
12 |
1.0 (1.7 or earlier) |
4.0 |
3.5 |
1.0 (85) |
|
Combination of a keyword and a <length> or <percentage> |
1.0 |
12 |
1.0 (1.7 or earlier) |
4.0 |
3.5 |
1.0 (85) |
|
Four-value syntax (support for offset from any edge) |
25.0 |
12 |
13.0 (13.0) |
9.0 |
10.5 |
7.0 |
|
Feature |
Android |
Chrome for Android |
Edge mobile |
Firefox Mobile (Gecko) |
IE mobile |
Opera Android |
iOS Safari |
|---|---|---|---|---|---|---|---|
|
Basic support |
(Yes) |
(Yes) |
(Yes) |
1.0 (1) |
(Yes) |
(Yes) |
(Yes) |
|
Combination of a keyword and a <length> or <percentage> |
(Yes) |
(Yes) |
(Yes) |
1.0 (1) |
(Yes) |
(Yes) |
(Yes) |
|
Four-value syntax (support for offset from any edge) |
(Yes) |
(Yes) |
(Yes) |
13.0 (13.0) |
(Yes) |
(Yes) |
7.1 |
关注公众号
低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
-
上一篇
AndroidStudio笔记(2)插件介绍
前言 Android Studio作为基于IDE的专业开发Android的开发工具,插件市场为我们提供了各种方便快捷、提高工作效率的插件,本文记录一些比较常用的插件。 插件 IDEA themes 严格意义上讲,这个并不算是插件,但是的确能为我们提供愉悦的编码心情。 就像这样的: ide themes 这里是地址:http://color-themes.com/ 1. 下载主题 选择你喜欢的主题进行下载,下载主题后会得到一个jar文件。 主题包 2. 导入主题 File –> Import Setttings –> 选中下载的主题jar文件 –> 确定->确定 –> 重启编译器 setting file GsonFormat 直接上图吧,将 JSON 字符串转换为Java实体bean GsonFormat GitHub地址 JsonToKotlinClass 与 GsonFormat 一样,对于使用 kotlin 开发的人也有类型的插件,能够直接将 JSON 字符串转换为 data class JsonToKotlinClass GitHub地址 Code...
-
下一篇
CSS-背景附件 | background-attachment
如果指定了background-image,那么background-attachment决定背景是在视口中固定的还是随包含它的区块滚动的。 /* Keyword values */ background-attachment: scroll; background-attachment: fixed; background-attachment: local; /* Global values */ background-attachment: inherit; background-attachment: initial; background-attachment: unset; 初始值 scroll 适用元素 all elements. It also applies to ::first-letter and ::first-line. 是否是继承属性 no 适用媒体 visual 计算值 as specified Animation type discrete 正规顺序 the unique non-ambiguous order defined by the formal...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- Docker容器配置,解决镜像无法拉取问题
- Windows10,CentOS7,CentOS8安装Nodejs环境
- Docker安装Oracle12C,快速搭建Oracle学习环境
- SpringBoot2初体验,简单认识spring boot2并且搭建基础工程
- Windows10,CentOS7,CentOS8安装MongoDB4.0.16
- CentOS6,CentOS7官方镜像安装Oracle11G
- SpringBoot2整合Thymeleaf,官方推荐html解决方案
- CentOS7编译安装Gcc9.2.0,解决mysql等软件编译问题
- SpringBoot2全家桶,快速入门学习开发网站教程
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池

微信收款码
支付宝收款码