首页 文章 精选 留言 我的

精选列表

搜索[附件预览],共8173篇文章
优秀的个人博客,低调大师

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 grammar 语法 background-attachment属性被指定为下面列表中的一个关键字值。 值 fixed——此关键字表示背景相对于视口固定。即使一个元素拥有滚动机制,背景也不会随着元素的内容滚动。 local——此关键字表示背景相对于元素的内容固定。如果一个元素拥有滚动机制,背景将会随着元素的内容滚动, 并且背景的绘制区域和定位区域是相对于可滚动的区域而不是包含他们的边框。 scroll——此关键字表示背景相对于元素本身固定, 而不是随着它的内容滚动(对元素边框是有效的)。 正式语法 <attachment>#where <attachment> = scroll | fixed | local 示例 简单例子 HTML <p> There were doors all round the hall, but they were all locked; and when Alice had been all the way down one side and up the other, trying every door, she walked sadly down the middle, wondering how she was ever to get out again. </p> CSS p { background-image: url("https://mdn.mozillademos.org/files/12057/starsolid.gif"); background-attachment: fixed; } 结果 多背景图支持 此属性支持多张背景图片。你可以用逗号分隔来为每一张背景图片指定不同的<attachment>。每一张背景图片顺序对应相应的attachment 类型。 HTML <p> There were doors all round the hall, but they were all locked; and when Alice had been all the way down one side and up the other, trying every door, she walked sadly down the middle, wondering how she was ever to get out again. Suddenly she came upon a little three-legged table, all made of solid glass; there was nothing on it except a tiny golden key, and Alice's first thought was that it might belong to one of the doors of the hall; but, alas! either the locks were too large, or the key was too small, but at any rate it would not open any of them. However, on the second time round, she came upon a low curtain she had not noticed before, and behind it was a little door about fifteen inches high: she tried the little golden key in the lock, and to her great delight it fitted! </p> CSS p { background-image: url("https://mdn.mozillademos.org/files/12057/starsolid.gif"), url("https://mdn.mozillademos.org/files/12059/startransparent.gif"); background-attachment: fixed, scroll; background-repeat: no-repeat, repeat-y; } 结果 规范 Specification Status Comment CSS Backgrounds and Borders Module Level 3The definition of 'background-attachment' in that specification. Candidate Recommendation The shorthand property has been extended to support multiple backgrounds and the local value. CSS Level 2 (Revision 1)The definition of 'background-attachment' in that specification. Recommendation No significant change. CSS Level 1The definition of 'background-attachment' in that specification. Recommendation No significant change. 浏览器兼容性 Feature Chrome Edge Firefox Internet Explorer Opera Safari Basic Support 1.0 12 1.0 4 3.5 1.0 Multiple backgrounds 1.0 12 3.6 9.0 10.5 1.3 local 1.0 12 25 9.0 10.5 5.0 Feature Android Chrome for Android Edge mobile Firefox for Android IE mobile Opera Android iOS Safari Basic Support (Yes) (Yes) (Yes) 1.0 (Yes) 10.0 3.2 Multiple backgrounds (Yes) (Yes) (Yes) (Yes) (Yes) 10.0 3.2 local ? (Yes) (Yes) 25 (Yes) ? ?

优秀的个人博客,低调大师

用OSS数据卷实现wordpress附件共享

docker容器的兴起,让wordpress的部署变得极为容易,“一分钟部署wordpress”的教程也随处可见。以阿里云容器服务为例,利用一下编排模板,可以一键部署wordpress(详细教程见这里)。 web: image: registry.aliyuncs.com/acs-sample/wordpress:4.3 ports: - '80' environment: WORDPRESS_AUTH_KEY: changeme WORDPRESS_SECURE_AUTH_KEY: changeme WORDPRESS_LOGGED_IN_KEY: changeme WORDPRESS_NONCE_KEY: changeme WORDPRESS_AUTH_SALT: ch

优秀的个人博客,低调大师

ECMAScript 2021 特性预览

最新举行的一次 TC39 会议正式确定了 ECMAScript 2021 的完整功能列表。具体包含以下内容: String.prototype.replaceAll 此前,如果想要替换所有的 string occurrences,则需要使用 String.prototype.replace 和全局 regexp 的组合。现在,String.prototype.replaceAll简化了这一点。 const string = "it-is-just-a-test"; // instead of doing this string.replace(/-/g, "_") // "it_is_just_a_test" // in ES2021 we can do string.replaceAll("-", "_") // "it_is_just_a_test" Promise.any 将 Promise.any 加入了 2021 年规范中的 Promise combinators 列表。当你想处理第一个 fulfills 的 Promise 时,可以使用 Promise.any。与 Promise.race 不同,当其中一个 promises fail 时,它不会 reject。更多详情可查看“Promise combinators explained”。 const API = "https://api.github.com/users" Promise.any([ fetch(`${API}/pawelgrzybek`), fetch(`${API}/gabriel403`) ]) .then(response => response.json()) .then(({name}) => console.log(`Cool dude is: ${name}`)) .catch(error => console.error(error)); WeakRefs WeakRefs 提案为语言带来了两个新的 contructors:WeakRef 和 FinalizationRegistry。这些新功能是更复杂、更低级的语言概念。 WeakRef 当将一个对象分配给一个变量时,它指向存储这个对象的值的那块内存(强引用)。如果程序不再引用这个对象,garbage collector会销毁它并回收内存。WeakRef 的一个实例创建了一个对给定对象的引用,如果该对象仍然在内存中,则返回该对象;如果目标对象已经被垃圾回收,则返回未定义的对象。 const obj = { spec: "ES2021" }; const objWeakRef = new WeakRef(obj); // do something cool objWeakRef.deref(); // returns obj in case it is still in memory // returns undefined in case it has been garbage collected FinalizationRegistry FinalizationRegistry 的实例在注册的目标对象被垃圾收集后触发回调函数。 const obj = { spec: "ES2021" }; const registry = new FinalizationRegistry(value => { console.log(`The ${value} object has been garbage collected.`) }); registry.register(obj, "ECMAScript 2021"); // perform some action that triggers garbage collector on obj // The ECMAScript 2021 object has been garbage collected. 值得注意的是,官方提示要尽量避免使用WeakRef和FinalizationRegistry,垃圾回收机制依赖于 JavaScript 引擎的实现,不同的引擎或是不同版本的引擎可能会有所不同。 Logical Assignment Operators 顾名思义,逻辑赋值运算符是逻辑运算符(&&, || and ??)和赋值运算符(=)的组合。 // set a to b only when a is truthy a &&= b; // set a to b only when a is falsy a ||= b; // set a to b only when a is nullish a ??= b; Numeric separators 数字的可读性随着数字长度的增加而降低。现在,则可以使用下划线(_, U+005F)来分隔数字组,使得长数字更加清晰可读。这个功能在 Java、Python、Perl、Ruby、Rust、Julia、Ada、C#等其他编程语言中也很有名。 const population = 37_653_260 详情可查看:https://pawelgrzybek.com/whats-new-in-ecmascript-2021/

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册