您的位置:首页 > Web前端 > HTML

Html(超文本标记语言)编写格式与常用控件归纳

2014-02-25 18:54 435 查看
HTML(Hyper Text Markup Language)--超文本标记语言

1.格式:
<html>

<head>
标题内容
</head>

<body>
实体内容
</body>

</html>

2.表格:
<table>
<tr>
// 行(tABLErOW),<th(tablehead)>加粗居中
<td>aa</td>
// 列
<td>aa</td>
// 第二列

</tr>

<tr>
// 第二行

</tr>
</table>

3.表单(Form):

<form>

username:<input type = "text">
// 输入框
password:<input type = "password">
// 密码框
兴趣:吃饭<input type = "checkbox">
// 复选框
   睡觉<input type = "checkbox">
  打豆豆<input type = "checkbox">

// 但选项
性别:男<input type = "radio" name = "gender">
  女<input type = "radio" name = "gender">

// 下拉框
学历:<select>
<option>小学</option>
<option>初中</option>
<option>高中</option>
<option>大学</option>
  </select>

评论:<textarea>
// 内容区域
   </textarea>

文件上传:<input type = "file">    // 选择文件

<input type = "submit" value = "submit">
// 提交
<input type = "reset" value = "reset">
// 刷新
<input type = "button" value = "button">
// button

<input type = "button" value = "button" onclick = "javascript:alert('hello world');">
// 带动作的按钮

图片:<img src = "小猴.jpg">
//图片地址可为连接url

</form>

注:每个控件中均有类似的属性,譬如<input type="text" name="username" id="usernameid">
input这个控件里面有三个属性,分别是type、name与username。可设置更多的属性,每个属性之间以空格隔开

4.注释
<!--  注释内容   -->

5.符号
<br>  
// 换一行
 
// 空格

6.浏览器内核:
WebKit, trident
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  html 控件 格式