ITeye博客

html的书写

angowang · 2014-05-28 01:26 · html · Web前端 · Markdown

作为web开发的基础知识,html是一种非常简单的标签语言。虽然简单,但是还是要重视的,因为结构良好的html标签可以方便你日后的维护,更重要的是美观的代码布局会降低你开发的倦怠性。一般的html文件如下:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="author" content="xxx" />
        <meta name="keywords" content="xxx,xxx,xxx" />
        <meta name="description" content="xxx" />
        <title>xxx</title>
        <link rel="stylesheet" type="text/css" href="xxx" />
    </head>
    <body>
        <div id="xxx" class="xxx"></div>
        <script type="text/javascript" src="xxx"></script>
    </body>
</html>

 书写html的时候一般有如下规则:

  1. 通过link标签在head中导入css文件;
  2. 通过script标签在</body>前导入js文件;
  3. 为了方便维护在head中添加<meta name="author" content="xxx" />;
  4. 为了方便搜索引擎搜索在head中添加<meta name="keywords" content="xxx" />和<meta name="description" content="xxx" />;
  5. 使用<div id="xxx" class="xxx"></div>进行布局,通过class="xxx"控制样式,通过id="xxx"操作节点。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。