HTML 5入门 (4)——特殊符号的使用

特殊符号的使用

一、HTML实体

  • 在 HTML 中,某些字符是预留的。如不能使用小于号(<)和大于号(>),这是因为浏览器会误认为它们是标签。要正确的显示预留字符,就需在 HTML 源代码中使用字符实体(character entities)。
符号 实体名称 实体数值 描述
    空格
< < < 小于
> > > 大于
& & & 连接符
“” " " 双引号
± ± ± 正负值
© © © 著作权
其他特殊符号可以在网上搜索

<html>
<head>
    <meta charset="utf-8">
    <title>symboltitle>
head>
<body>
    <table border="1" align="center">
        <caption><font color="green" face="仿宋">特殊符号的使用font>caption>
        <colgroup style="width: 100px " span="1">
            <col style="background: white" span="1">
        colgroup>
        <colgroup style="width: 200px " span="2">
            <col style="background: grey" span="2">
        colgroup>
        <colgroup style="width: 100px" span="1">
            <col style="background: white" span="1">
        colgroup>
        <thead style="background: #FFEBCD">
            <tr>
                <th>符号th><th>实体名称th><th>实体数值th><th>描述th>
            tr>           
        thead>
        <tbody align="center">
            <tr>
                <td>td><td>&nbsp;td><td>&#160;td><td>空格td>
            tr>
            <tr>
                <td>><td>&lt;td><td>&#62;td><td>小于td>
            tr>
            <tr>
                <td>>td><td>&gt;td><td>&#38;td><td>大于td>
            tr>   
            <tr>
                <td>&td><td>&amp;td><td>&#38;td><td>连接符td>
            tr>
            <tr>
                <td>±td><td>&plusmn;td><td>&#177;td><td>正负号td>
            tr>
            <tr>
                <td>©td><td>&copy;td><td>&#169;td><td>著作权td>
            tr>                   
        tbody>
        <tfoot>
            <td colspan="4" style="background: pink">其他的特殊符号可在网上搜索td>
        tfoot>
    table>

body>
html>

浏览器页面显示如下:
HTML 5入门 (4)——特殊符号的使用_第1张图片

在实体名称的表达式前加上&,使表达式在页面上显示出来(&nbsp;&#160;空格)。

你可能感兴趣的:(HTML 5入门 (4)——特殊符号的使用)