HTML番外篇-部分命令

100 阅读2分钟

持续创作,加速成长!这是我参与「掘金日新计划 · 10 月更文挑战」的第10天,点击查看活动详情

目录

在HTML中可直接应用的颜色

部分命令

颜色及格式

id属性

 通过HTML调用文件

 

 HTML中支持的数学符号

 HTML刷题网站



 

在HTML中可直接应用的颜色

     Aqua水

fuchsia紫红色

lime石灰

maroon栗色

navy海军蓝

olive橄榄

silver银色

teal蓝绿色

部分命令

表格内容 表格行 表头

< >空格

标题
占行数 占列数
    无序列表
  • 圆点

    自定义列表以 

     标签开始。每个自定义列表项以 

    有序列表始于 

       标签。每个列表项始于 
    1.  标签。


       标签在 HTML 页面中创建水平线

      颜色及格式

      <html>
       
       
       
      <body style="background-color:yellow">
       
      <h2 style="background-color:red">This is a heading</h2>
       
      <p style="background-color:green">This is a paragraph.</p>
       
      </body>
       
       
       
      </html>
       
      <!DOCTYPE html>
       
      <html>
       
      <head>
       
      <style>
       
        span.red {color:red;}
       
      </style>
       
      </head>
       
      <body>
       
       
       
      <h1>My <span class="red">Important</span> Heading</h1>
       
       
       
      </body>
       
      </html>
       
       
       
      <!DOCTYPE html>
       
      <html>
       
      <head>
       
      <style>
       
      .cities {
       
          background-color:black;
       
          color:white;
       
          margin:20px;
       
          padding:20px;
       
      }
       
      </style>
       
      </head>
       
       
       
      <body>
       
       
       
      <div class="cities">
       
      <h2>London</h2>
       
      <p>London is the capital city of England.
       
      It is the most populous city in the United Kingdom,
       
      with a metropolitan area of over 13 million inhabitants.</p>
       
      </div>
       
       
       
      <div class="cities">
       
      <h2>Paris</h2>
       
      <p>Paris is the capital and most populous city of France.</p>
       
      </div>
       
       
       
      <div class="cities">
       
      <h2>Tokyo</h2>
       
      <p>Tokyo is the capital of Japan, the center of the Greater Tokyo Area,
       
      and the most populous metropolitan area in the world.</p>
       
      </div>
       
       
       
      </body>
       
      </html>
      

      id属性

      id属性用于为 HTML 元素指定唯一的 id

      id属性的值在 HTML 文档中必须是唯一的

      CSS 和 JavaScript 可使用id属性来选取元素或设置特定元素的样式

      id属性的值区分大小写

      • id属性还可用于创建 HTML 书签

        JavaScript 可以使用getElementById() 方法访问拥有特定 id 的元素

      通过HTML调用文件

      删除边框

      <iframe src=”demo_iframe.htm”frameborder=”0”>

      元素定义计算机输出示例

      元素定义编程代码

      (以下部分列表来自W3school)

      定义计算机代码文本
      定义键盘文本
      定义计算机代码示例
      定义变量
      定义预格式化文本

      ****

      空格  
      小于号<<
      大于号>>
      &和号&&
      "引号""
      '撇号 '
      分(cent)¢¢

      HTML中支持的数学符号

      FOR ALL
      PARTIAL DIFFERENTIAL
      THERE EXISTS
      EMPTY SETS
      NABLA
      ELEMENT OF
      NOT AN ELEMENT OF
      CONTAINS AS MEMBER
      N-ARY PRODUCT
      N-ARY SUMMATION

      \