Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 社交媒体链接在多个div标签中重复_Html_Css - Fatal编程技术网

Html 社交媒体链接在多个div标签中重复

Html 社交媒体链接在多个div标签中重复,html,css,Html,Css,我需要在页面上添加社交媒体链接,但它们会重复很多次。我发现它与它所在的嵌套div标记的数量有关。例如,此项重复4次: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link rel="stylesheet" href="https://cd

我需要在页面上添加社交媒体链接,但它们会重复很多次。我发现它与它所在的嵌套div标记的数量有关。例如,此项重复4次:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
</head>
<body >
    <form id="form1" runat="server">
        <div>
            <div>
                <div>
                    <a class="fa fa-facebook" href="#" />
                </div>
            </div>
        </div>
    </form>
</body>
</html>

你知道怎么解决这个问题吗

我在这里找到了这个的代码:


在代码中,您忘记关闭“a”标记


Hmmm。谢谢。事实上我没有忘记。我想,如果你不需要在开始和结束标记之间放置任何东西,你可以用“/>”来关闭开始标记,它现在就可以完美地工作了。再次感谢!
<html>
<head runat="server">
    <title></title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
</head>
<body >
    <form id="form1" runat="server">
        <div>
            <div>
                <div>
                    <a class="fa fa-facebook" href="#" /></a>
                </div>
            </div>
        </div>
    </form>
</body>
</html>