领先的免费Web技术教程,涵盖HTML到ASP.NET

网站首页 > 知识剖析 正文

html的书写基本格式及常见错误 html的规范

nixiaole 2024-12-17 15:39:11 知识剖析 17 ℃

html的书写基本格式及常见错误

html的标准书写方式如下:

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8"/>

<title>account statistics</title>

<meta name="keywords" content="account,statistics"/>

<meta name="description" content="this is account statistics"/>

<link type="image/x-icon" rel="shortcut icon" href="favicon.ico"/>

<link type="text/css" rel="stylesheet" href="./css/index.css"/>

<script type="text/javascript" src="./js/index.js"></script>

</head>

<body>


<div class="allcontent">

<div class="allc_title"><h1>account statistics</h1><span>there are xx data add data</span></div>

<div class="allc_content">

<table width="1000">

<tr>

<td>id</td>

<td>sort</td>

<td>categorize</td>

<td>website</td>

<td>account</td>

<td>password</td>

<td>remark</td>

<td>action options</td>

</tr>


<tr>

<td>id</td>

<td>sort</td>

<td>categorize</td>

<td>website</td>

<td>account</td>

<td>password</td>

<td>remark</td>

<td>revise | delete</td>

</tr>

</table>

</div>

</div>

</body>

</html>

其中用到的css代码如下:

body,html,ul,li,h1{margin:0;padding:0}

li{list-style:none}

table{border-collapse:collapse;}

th,td{border:1px solid black;text-align:center}

.allcontent{width:1024px;height:auto;margin:0px auto;background-color:red}

.allc_title{width:1024px;height:auto;font-size:24px; font-family:黑体;float:left;text-align:center}

.allc_title h1{font-size:24px;text-align:center;}

.allc_content{width:1024px; height:auto;float:left}

.allc_content ul{width:1024px;height:auto;float:left;border:1px solid black}

.allc_content ul li{width:auto;height:auto;float:left;margin:0px 10px;border-left:1px solid black}

在以上html中需要注意的几个常见问题,见图下:

如上图所示,看看自己的常见错误在哪里?

Tags:

最近发表
标签列表