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. (Oracle)数据库用户的密码过期时间如何修改为永不过期

    Oracle的密码过期规则是用Profile来管理的,系统默认只有一个Profile(DEFAULT),该profile的密码过期规则为180天.那么如何修改Oracle数据库用户的密码过期时间为永不 ...

  2. 文件系统层次结构标准 Linux 系统目录结构

    https://zh.wikipedia.org/wiki/文件系统层次结构标准 多数Linux发行版遵从FHS标准并且声明其自身政策以维护FHS的要求. [3] [4] [5] [6] 但截至200 ...

  3. the minimum number of bits required to represent x 最小位数

    src/math/bits/bits.go:296 // --- Len ---// Len returns the minimum number of bits required to repres ...

  4. Pycharm 使用学习

    作为一个菜鸟,为了督促自己坚持学习python,记录每日学习日记是一个不错的选择 电脑安装python,python可以丛网络上下载相关版本进行安装,目前我电脑安装的是pyhon 3.7.3的版本,p ...

  5. Excel 多种粘贴方式

    一.粘贴为数值. 这个功能是选择性粘贴中最常用的功能.因为excel主要功能之一就是用来做数据分析,把其他格式粘贴为数据格式才能进行数据运算,把带有公式的计算结果粘贴为数值格式可以使复制后的内容不会变 ...

  6. SpringCloud及其组件详解

    SpringCloud及其组件详解 1.Spring Cloud 1.1 Spring Cloud和Dubbo的区别图解 1.2 微服务的技术栈 2.Spring Cloud 概述 2.1 Sprin ...

  7. 设计模式(十五)——命令模式(Spring框架的JdbcTemplate源码分析)

    1 智能生活项目需求 看一个具体的需求 1) 我们买了一套智能家电,有照明灯.风扇.冰箱.洗衣机,我们只要在手机上安装 app 就可以控制对这些家电工作. 2) 这些智能家电来自不同的厂家,我们不想针 ...

  8. 为什么对gRPC做负载均衡会很棘手?

    在过去的几年中,随着微服务的增长,gRPC在这些较小的服务之间的相互通信中获得了很大的普及,在后台,gRPC使用http/2在同一连接和双工流中复用许多请求. 使用具有结构化数据的快速,轻便的二进制协 ...

  9. 洛谷P4719 【模板】"动态 DP"&动态树分治

    [模板]"动态 DP"&动态树分治 第一道动态\(DP\)的题,只会用树剖来做,全局平衡二叉树什么的就以后再学吧 所谓动态\(DP\),就是在原本的\(DP\)求解的问题上 ...

  10. Happy 2006 POJ - 2773 容斥原理+二分

    题意: 找到第k个与m互质的数 题解: 容斥原理求区间(1到r)里面跟n互质的个数时间复杂度O(sqrt(n))- 二分复杂度也是O(log(n)) 容斥原理+二分这个r 代码: 1 #include ...