且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

关闭标记中的HTML ID属性?

更新时间:2023-12-05 21:06:10

否。 id 属性应该只在开始标签。

No. The id attribute should only be in the opening tag.

如果你这样做是为了可读性,你可能想使用HTML注释和标签来源:

If you're doing this for readability, you might want to use HTML comments and tabified source:

<html>
    <body>
        <div id="main">

        </div>
        <!-- close main div -->
    </body>
</html>