注意 – 编辑CSS以使横跨元素宽度的渐变跨度,而不仅仅是边框宽度.

这就是我所提出的,这或多或少是h3n建议填充的更多特定于供应商的属性:

border-right: 5px solid #000; /* Don't forget to modify to the right border. */

background-image:

-webkit-gradient(linear,to(transparent));

background-image:

-webkit-linear-gradient(180deg,#000,-webkit-linear-gradient(180deg,transparent)

;

background-image:

-moz-linear-gradient(180deg,-moz-linear-gradient(180deg,transparent)

;

background-image:

-o-linear-gradient(180deg,-o-linear-gradient(180deg,transparent)

;

background-image:

linear-gradient(90deg,linear-gradient(90deg,transparent)

;

-moz-background-size: 100% 5px; /* This get flipped. */

background-size: 100% 5px; /* This get flipped. */

background-position: 0 0,0 100%; /* The last argument gets flipped. */

background-repeat: no-repeat;

MDN还有关于如何处理这种跨浏览器的reasonable tutorial.

现在,如果仔细观察,您可能会注意到非供应商背景图像使用90deg而不是180deg.我最初的想法是-90deg,所以当然这对我来说是有道理的(?),但至于为什么它们不同,这里是W3 spec(见这个差异背后推理的最后一个引用):

4.1.1. linear-gradient() Syntax

The linear gradient Syntax is:

= linear-gradient(

[ [ | to ],]?

[,]+

)

= [left | right] || [top | bottom]

The first argument to the function specifies the gradient line,which gives the gradient a direction and determines how color-stops are positioned. It may be omitted; if so,it defaults to ‘to bottom’.

The gradient line’s direction may be specified in two ways:

using angles

For the purpose of this argument,‘0deg’ points upward,and positive angles represent clockwise rotation,so ‘90deg’ point toward the right.

using keywords

If the argument is ‘to top’,‘to right’,‘to bottom’,or ‘to left’,the angle of the gradient line is ‘0deg’,‘90deg’,‘180deg’,or ‘270deg’,respectively.

If the argument instead specifies a corner of the Box such as ‘to top left’,the gradient line must be angled such that it points into the same quadrant as the specified corner,and is perpendicular to a line intersecting the two neighboring corners of the gradient Box. This causes a color-stop at 50% to intersect the two neighboring corners (see example).

Starting from the center of the gradient Box,extend a line at the specified angle in both directions. The ending point is the point on the gradient line where a line drawn perpendicular to the gradient line would intersect the corner of the gradient Box in the specified direction. The starting point is determined identically,but in the opposite direction.

并从MDN,some administrivia了解为什么学位不同(归咎于Apple?):

A last semantic curiosity still exists between the prefixed variants

and the unprefixed proposal. Following the initial Apple proposal,the

prefixed variants of the Syntax all uses the an defined like

polar angles,that is with 0deg representing the East. To be coherent

with the rest of CSS,the specification defines an angle with 0deg

representing the North. To prevent sites using prefixed version of the

property to get suddenly broken,even when adapting to the otherwise

forward-compatible final Syntax,they keep the original angle

definition (0deg = East). They will switch to the correct spec when unprefixing the property. Also,as they aren’t incompatible,Gecko supports,prefixed,both the Syntax with the to keyword and without. Here again,the Syntax without the keyword will be dropped when unprefixing.

html怎么用div从左到右,单独使用CSS,你怎么能有一个从右到左的边框底部渐变?...相关推荐

  1. CSS如何实现两个a标签元素的文字一个靠左一个靠右,并且能点击分别不同的链接

    CSS如何实现两个a标签元素的文字一个靠左一个靠右,并且能点击分别不同的链接 作为一个非专业前端,有时候开发又必须自己写一些简单的前端,在网上有时候不能及时查找到内容,只能自己尝试,如下是实现两个sp ...

  2. html div左中右布局,求助css。 一个div包含两个div,左右布局,左边css宽30%,右边div宽70%。高度均自...

    求助css. 一个div包含两个div,左右布局,左边css宽30%,右边div宽70%.高度均自以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容,让 ...

  3. mysql 左对齐_CSS:左对齐标签,右对齐(CSS : Align label left, text right)

    CSS:左对齐标签,右对齐(CSS : Align label left, text right) 我有这样的文字: AAA : aaaaaaaaaaaaaaaaaa B : bbbbb CCCCC ...

  4. 布局 flex让元素一个靠左一个靠右

    flex让一个元素靠左一个靠右 .about { // 父元素display: flex;justify-content: flex-end;} 需要靠右的元素加上margin-left: auto;

  5. 魅族与小米 一个向左一个向右

    原创文章,转载请注明: 转载自电商沙龙,专研电商艺术 本文链接地址: 魅族与小米,一个向左,一个向右. 小米3的发布会在昨天已经过去,相比魅族MX3的发布会,小米的人气显然要旺一些.这两家一直都被拿来 ...

  6. html中的左浮动的作用,CSS浮动

    float是css样式中的定位属性,用于设置标签对象(如: 标签盒子.标签.标签.标签等html标签)的浮动布局,浮动也就是我们所说标签对象浮动居左靠左(float:left)和浮动居右靠右(floa ...

  7. html5 居于页面中心,css笔记:如何让一个div居于页面正中间

    如何让一个div居于页面中间,我今天说的是让一个div水平居中同时垂直居中,而不是简单的top:50%,left:50%.当然,我们就按一开始的思路写一下:top,left属性都设为50%,看一下效果 ...

  8. [css] 实现单行文本居中和多行文本左对齐并超出显示“...“

    [css] 实现单行文本居中和多行文本左对齐并超出显示"-" .one {text-align: center }.multi {overflow: hiddentext-over ...

  9. [css] 如何使用css3实现一个div设置多张背景图片?

    [css] 如何使用css3实现一个div设置多张背景图片? background-image:url("1.jpg"),url("2.jpg"),url(&q ...

最新文章

  1. 【TP3.2】模板 select选项采坑
  2. CSDN博客越来越垃圾了,到处放广告
  3. 【编译原理】递归下降的预测分析(真の能看懂~!)
  4. VC++ CFileDialog文件选择对话框的构造和文件操作
  5. filter过滤器_web容器的过滤器Filter和拦截器Inteceptor的区别
  6. 题目1198:a+b
  7. 语音识别(1)---语音识别(ASR)评估指标-WER(字错误率)和SER(句错误率)
  8. Spring中Bean管理操作基于XML配置文件方法实现
  9. Linux:网络安全与主机基本防护:限制端口, 网络升级与 SELinux
  10. 北理珠大学生体质测试及健康状况的分析
  11. sql日期中文大写显示
  12. wtl单文档选项_WTL体系结构
  13. Harvard (name and date) 论文引用格式
  14. Python NLPIR(中科院汉语分词系统)的使用 十五分钟快速入门与完全掌握
  15. 基于Qt的网络五子棋游戏对战
  16. 【特征】PSI的计算
  17. 多模态 |COGMEN: COntextualized GNN based Multimodal Emotion recognitioN论文详解
  18. 热插拔与非热插拔的区别
  19. js判断早上好,上午好,下午好,傍晚好,晚上好
  20. python面向对象的特征_python 面向对象的三大特性

热门文章

  1. halcon学习之图像增强、平滑和去噪
  2. ztree 异步展开节点显示不出来_用户管理、角色管理、模块管理、zTree的使用
  3. 让自律成为你2019年的新名片,快来看这24种建议
  4. 加州伯克利计算机专业录取条件,加州大学伯克利分校计算机专业申请要求
  5. 学校运动会广播稿计算机,学校运动会广播稿【五篇】
  6. 多媒体计算机技术英文,掌握多媒体计算机技术中各专业语句的英文表达方式.doc...
  7. 5v 3.3v电平转换电路_3.3V与5V系统电平兼容的方法探究
  8. 转:Oracle数据库一致性读的原理(Consistent Read)
  9. Vue.js(2.x)之插值
  10. ANT发送邮件需要的3个JAR包