首页 > 其他分享 >html书写规范

html书写规范

时间:2023-01-09 23:00:45浏览次数:32  
标签:clipboardErrorCopied 缩进 书写 规范 html nbsp tab 标签 Copy

标签换行写法

<div>
    <p>
        今天的天
        <span>真的好啊</span>
    </p>
</div>Copy to clipboardErrorCopied

 

标签需要关闭

<p>
    <span>哈哈哈哈哈</span>
    <em>呵呵呵呵</em>
</p>Copy to clipboardErrorCopied

 

代码缩进使用tab键

tab每次缩进空格数量一样,我们可以设置。也为了方便代码合并 shift+tab是向前缩进

标签的正确嵌套

<ul>
    <li></li>
    <li></li>
</ul>
<dl>
    <dt></dt>
    <dd>

    </dd>
</dl>Copy to clipboardErrorCopied

 

合理加注释

a标签不能嵌套a标签

<a href="">
    <a href=""></a>
</a>Copy to clipboardErrorCopied

 

特殊符号的实体

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>特殊符号的实体</title>
</head>
<body>
    <!--
        使用实体
        在html中,会把一个或多个空格或回车解析成一个空格显示
        在html中 特殊符号,一般不会直接书写,而是使用代表这个符号的实体(编码)

        空格: &nbsp;
        大于:&gt;
        小于:&lt;
        版权:&copy;
        双引号:&quot;
    -->
    <p>今天天&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;气好晴朗</p>
    &gt;&lt;&copy;&quot;

</body>
</html>

 

标签:clipboardErrorCopied,缩进,书写,规范,html,nbsp,tab,标签,Copy
From: https://www.cnblogs.com/z-bky/p/17038776.html

相关文章

  • HTML_5_表单
    表单是指发送给服务器的数据。  步骤:1、使用form标签声明一个表单域。属性:action,目的地的url。method,提交方式:get,适合小量数据,显式提交,不安全。pos......
  • HTML超文本标记语言3
    三、HTML表单标签1.form标签<form>form标签name=表单名称,action=表单提交的地址,method_=表单提交方式:get/postget/post详解:1.get提交数据时:把数......
  • c# webview2获取网页HTML的绝招
    usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSyste......
  • Echarts做仪表图-含HTML直接保存加个JS文件就可以用
    <!DOCTYPEhtml><html><head><metacharset="utf-8"><title>echarts</title><!--引入echarts.js--><scriptsrc="echarts.js"></script></head><bodyst......
  • 用python处理html代码的转义与还原-转
    本篇博客来源:用python处理html代码的转义与还原&#x27;&amp;&lt;&gt;&quot;&#x27;等特殊字符摘要:html转义:importhtml#字符串转义str="<tag>aaa</tag>"str_out=......
  • 2023新年红包,兔年HTML红包页面代码【2023新年快乐_附源码】
    一.新年红包,兔年HTML红包页面1.1资源获取和效果预览1.源码资源获取:https://download.csdn.net/download/weixin_52908342/87373505快速通道:点击跳转下载新年红包,兔年......
  • HTML超文本标记语言2
    二、基本标签1.文件标签(结构)<html>根标签<head><title>页面标题(标签)</title></head><body>页面所有内容包括:......
  • HTML_4_内嵌标签与框架标签
    内嵌标签:iframe,在页面内选定一块区域显示指定的其它网页。例子:实现了点击超链接后在页面内的窗口,打开对应网页。<html><head><title>内嵌标签学习</......
  • html snippets
    SomeusefulUnicodeentitiesNon-BreakingSpacesnippetnbs ←snippetleft←→snippetright→↑snippetup↑↓snippetdown↓↩snippetreturn↩......
  • HTML_2_常用head标签
    head标签是html组成的一个部分,主要用于配置页面信息。  标题标签:<title>网页标题!</title>编码格式标签:<!--编码配置:html5--><metacharset="UTF-8"><!--编......