HTML Custom Elements (v1)

https://developers.google.com/web/fundamentals/web-components/customelements

Web Components

https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements

https://caniuse.com/#search=HTML Custom Elements

Web Components

Web components is a meta-specification made possible by four other specifications:

The Custom Elements specification

The shadow DOM specification

The HTML Template specification

The ES Module specification

https://www.webcomponents.org/specs

Custom Elements

An unknown autonomous custom element is like a element: its default CSS display property is inline

浏览器不能识别的 HTML Tag 等效于 span 元素, 即 custom element 如果没有使用 web components 的规范进行 element 注册的话!

  1. autonomous custom elements

,好使,自己完全控制(属性,事件,可访问性)

  1. customized built-in elements / extending native HTML elements

,不好使,浏览器支持度不高,不推荐

demo

UFO, 未注册的 custom element

See the Pen HTML5 custom element tag by xgqfrms
(@xgqfrms) on CodePen.

UFO, 注册的 custom element

See the Pen HTML5 custom element tag (web components) by xgqfrms
(@xgqfrms) on CodePen.

Shadow DOM

https://www.webcomponents.org/specs#the-shadow-dom-specification

refs

https://www.webcomponents.org/specs

https://html.spec.whatwg.org/multipage/custom-elements.html

https://stackoverflow.com/questions/40323660/best-practices-autonomous-custom-elements-vs-extending-native-html-elements-cu

https://github.com/w3c/webcomponents/issues/509

IMHO / 恕我直言



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


HTML Custom Elements (v1)的更多相关文章

  1. Web Components之Custom Elements

    什么是Web Component? Web Components 包含了多种不同的技术.你可以把Web Components当做是用一系列的Web技术创建的.可重用的用户界面组件的统称.Web Com ...

  2. 自定义元素(custom elements)

    记录下自定义html自定义元素的相关心得: 浏览器将自定义元素保留在 DOM 之中,但不会任何语义.除此之外,自定义元素与标准元素都一致 事实上,浏览器提供了一个HTMLUnknownElement, ...

  3. [HTML5] Render Hello World Text with Custom Elements

    Custom elements are fun technology. In this video, you will learn how to set one up and running in l ...

  4. 使用custom elements和Shadow DOM自定义标签

    具体的api我就不写 官网上面多  如果不知道这个的话也可以搜索一下 目前感觉这个还是相当好用的直接上码. <!DOCTYPE html> <html lang="en&q ...

  5. window 属性:自定义元素(custom elements)

      概述 Web Components 标准非常重要的一个特性是,它使开发者能够将HTML页面的功能封装为 custom elements(自定义标签),而往常,开发者不得不写一大堆冗长.深层嵌套的标 ...

  6. HTML Custom Elements & valid name

    HTML Custom Elements & valid name valid custom element name https://html.spec.whatwg.org/multipa ...

  7. [Polymer] Custom Elements: Styling

    Code: <dom-module id="business-card"> <template> <div class="card" ...

  8. Knockoutjs:Component and Custom Elements(翻译文章)

    Knockoutjs 的Components 是一种自定义的组件,它以一种强大.简介的方式将你自己的ui代码组织成一种单独的.可重用的模块,自定义的组件(Component)有以下特点: 1.可以替代 ...

  9. webAssmebly实现js数组排序 使用custom elements和Shadow DOM自定义组件

    直接上码了……………… .wat源码 (module (type $t0 (func (param i32 i32))) (type $t1 (func (result i32))) (type $t ...

随机推荐

  1. FlightGear 从输出所省略的额外重寻址溢出

    2020-12-27 在龙芯Fedora28上编译 FlightGear 2019.1.1 时遇到 从输出所省略的额外重寻址溢出 错误,错误信息如下: [ 98%] Linking CXX execu ...

  2. LIS的优化

    二分优化 在求一个最长不上升自序列中,显然其结尾元素越小,越有利于接其他元素,对答案的贡献也就可能会更高 那么我们可以用low[i]去存长度为i的LIS结尾元素的最小值 因此我们只要维护low数组 对 ...

  3. 基于粒子群算法的分组背包MATLAB实现

    抽空看了一段时间的粒子群算法,这里仅针对其应用于动态规划中的背包问题的情况做下总结归纳,其他应用可以之后想到了再添加. 一:分组背包问题简介 假设有3个组,每组有2个物品,每种物品有3种属性,价值.体 ...

  4. how2j SpringMVC学习心得

    http://how2j.cn/k/springmvc/springmvc-form/618.html 注意 addProduct.jsp 是放在了WebContent(即web目录)下,访问的时候, ...

  5. SparkMLlib—协同过滤推荐算法,电影推荐系统,物品喜好推荐

    SparkMLlib-协同过滤推荐算法,电影推荐系统,物品喜好推荐 一.协同过滤 1.1 显示vs隐式反馈 1.2 实例介绍 1.2.1 数据说明 评分数据说明(ratings.data) 用户信息( ...

  6. TcaplusDB常见问题-数据库原理类

    gameserver 如何剔除某个无效的 tcaproxy(接入层)节点? TcaplusDB API 在这里对 tcaproxy 异常做了容灾的处理,API 剔除无效的 tcaproxy 进程的方式 ...

  7. Codeforce 380A Sereja and Prefixes【二分】

    题意:定义两种操作 1 a ---- 向序列中插如一个元素a 2 a b ---- 将序列的前a个元素[e1,e2,...,ea]重复b次插入到序列中 经过一列操作后,为处于某个位置p的元素是多少.数 ...

  8. Codeforces Global Round 7 C. Permutation Partitions(组合数学)

    题意: 给你 n 长全排列的一种情况,将其分为 k 份,取每份中的最大值相加,输出和的最大值和有多少种分法等于最大值. 思路: 取前 k 大值,储存下标,每两个 k 大值间有 vi+1 - vi 种分 ...

  9. 【uva 1471】Defense Lines(算法效率--使用数据结构+部分枚举+类贪心)

    P.S.我完全一个字一个字敲出来的血泪史啊~~所以,没有附代码,也是可以理解的啦.OvO 题意:给一个长度为N(N≤200000)的序列,要删除一个连续子序列,使得剩下的序列中有一个长度最大的连续递增 ...

  10. hdu1004 Let the Balloon Rise

    Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...