How to customize tags in html

墨辰丷
Release: 2018-05-16 09:51:06
Original
6912 people have browsed it

This article mainly introduces how to customize HTML tags. Friends who are interested can refer to it. I hope it will be helpful to everyone.

The code is as follows:

<!DOCTYPE html>
<!-- 通过指定html命名空间的名字来定义自定义标签;
     默认的一些标签p p等都在html默认的命名空间下。
-->
<!-- 第一步:自定义的标签可以放在自定义的命名空间下,可通过xmlns:命名空间名 来指定 -->
<html xmlns:mine>
<head>
    <meta charset="UTF-8">
    <title>自定义标签</title>
    <style>
        /* 第三步: 自定义标签在设置样式的时候使用 " 命名空间名\:标签名  "    */
        mine\:tag {            
        font-size: .36rem;            
        font-weight: bold;            
        color: red;        
        }

        p {            
        font-size: 25px;            
        color: chocolate;        
        }
    </style>
    </head>
    <body>
    <p>this is normal text</p>
    <!-- 第二步: 自定义标签需要带命名空间名 " 命名空间名:标签名 " -->
    <mine:tag>this is custom text</mine:tag>
    </body>
</html>
Copy after login

Related recommendations:

How Vue operates html field strings and converts them into HTML tags

How to convert the html fields in the data into HTML tags

Convert the string with html tags into HTML tags

The above is the detailed content of How to customize tags in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!