【问题标题】:Where can I find a list of all special HTML characters? [closed]在哪里可以找到所有特殊 HTML 字符的列表? [关闭]
【发布时间】:2014-12-15 14:06:47
【问题描述】:

我正在向网站添加各种物理方程。我需要添加几个特殊字符,但我无法找到其中的一些(例如,我需要添加一个卷曲的“E”来表示能量密度,并且我需要添加一个 H顶部的“^”符号表示哈密顿算子)。

因此,我想知道是否有人编制了所有各种 HTML 特殊字符的表格(例如 ħ 表示 h-bar,等于 h/2PI)。如果是这样,一个链接将不胜感激!谢谢!

【问题讨论】:

  • 您可以将问题改写为:如何在网站上显示物理方程?我已经尝试在以下实例中使用 HTML 特殊字符,但我找不到我需要的所有内容的列表。
  • 你也可以试试 MathJax:mathjax.org
  • DuckDuckGo 提供了相当广泛的 html 实体列表:html entities at DuckDuckGo

标签: html character special-characters


【解决方案1】:

只需一点 Javascript,您就可以构建自己的:

Unicode UTF-8 characters generator

function el(id) {return document.getElementById(id); }

var from = 8000; // Start from 
var show = 1000; // How many to show
var cont = el("container");
var prev = el("prev");
var next = el("next");
var curr = el("curr"); 


function prevNext(){
  from = this.id === "next" ? from+=show : from-=show;
  if(from>=0)createUnicodeChars();
  else from=0;
}

function createUnicodeChars() {
  var spans = "";
  for(var i=from; i<from+show; i++){
    var uc = i.toString(16);
    spans += "<span>&#"+i+";<br><small>&amp;#"+i+";<br>\\"+uc+"</small></span>";
  }

  curr.innerHTML = from +' - '+ (from+show);
  cont.innerHTML = spans;
}

prev.onclick = prevNext;
next.onclick = prevNext;

createUnicodeChars(); // First run!
body{background:#eee;}
span{
  position:relative;
  display:inline-block;
  width: 80px;
  padding:10px;
  height:80px;
  margin:3px;
  font-size:2em;
  text-align:center;
  vertical-align:top;
  background:#fff;
  border:1px solid #aaa;
  border-radius:5px;
  box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}
span small{
  position:absolute;
  width:80%;
  bottom:5px;
  text-align:ccenter;
  display:block;
  font-size:12px;
  line-height:14px;
}
#container{
  margin-top:50px;
  text-align:center;
}
#controls{
  background:#fff;
  box-shadow: 0 0 20px #000;
  position:fixed;
  z-index:1;
  top:0;
  left:0;
  padding:10px;
  width:100%;
  text-align:center;
}
<div id="controls">
      <button id="prev">PREV</button>
      <b id="curr"></b>
      <button id="next">NEXT</button>
</div>
<div id="container"></div>

会给你字符表示
Unicode 字符的数字 HTML 编码&amp;#num;
UTF-8 十六进制。代码 \hex(你可以在CSS中使用:after:before内容jsBin

【讨论】:

    【解决方案2】:

    这个怎么样,来自 w3 org:

    http://dev.w3.org/html5/html-author/charref

    【讨论】:

      猜你喜欢
      • 2010-10-09
      • 1970-01-01
      • 1970-01-01
      • 2018-11-11
      • 1970-01-01
      • 1970-01-01
      • 2021-01-21
      • 1970-01-01
      • 2011-01-18
      相关资源
      最近更新 更多