HTML学习

HTML文件结构

<html>                                                                                                                                                //根标签

<head>                                                                                                                                      //头标签:

<meta charset ="UTF-8">

<meta name="Keywords" content="关键词关键字">                  //76个字以内

<meta name="Description" content="网页描述信息">               

<title>38个字以内</title>                                                                                                            //title之间的内容会在出现在浏览器的标题栏中,每个网页都应该有独一无二的title

<meta>

<link>

<style>

Span{

color:blue;

}

 

<style>

<script><script>

</head> 

<body>                                                                                                                                         //文章的主要内容:

<h1>文章的一级标题</h1>                                                                                        // <h>标签表示文章的标题,有<h1><h6>

<p>                                                                                                                                     //P标签表示文章的段落,每一段用一个P标签,P标签默认的每一段段前段后空一行

<em>默认采用斜体</em>                                                                                   //强调内容

<strong>默认采用粗体</strong>    

<span></span>                                                                                                    //为文字设置单独的样式,但是需要在头标签中指定样式

<q>引用简短文本</q>                                                                                           //自动为引用的文本加双引号

<blockquote></blockquote>                                                                               //引用长文本,默认在前后添加缩进

换行标签<br/>

添加水平横线<hr/>                                       

       空格标签&nbsp;                                                                                                          //一个&nbsp;表示一个空格

<address>地址信息</address>                                                                              //默认采用斜体

<code>插入一行代码</code>

<pre>插入多行代码</pre>

<ul>                                                                                                                              //无序信息表

<li>

无须信息列表                                                                                        //默认前面带一个原点

</li>

</ul>

<ol>                                                                                                                             //有序信息表

<li></li>                                                                                                          //默认带序号的列表 1.

<li></li>                                                                                                                                               2.

</ol>

 

</p>

<div id="版块号"></div>                                                                                              // 为网页划分独立的板块,id为板块号

<table summary ="表格的简介文本">                                                                          //创建表格,默认是没有线的

< caption>表格的标题</caption>                                                                         //显示在表格上方

<tr>                                                                                                                              //有几个<tr></tr>表格就有几行

<th></th>                                                                                                      //表格表头,表格头部的单元格,默认粗体并居中

<td></td>                                                                                                       //表格的单元格,有几个<td>表格就有几列

</tr>                                      

</table>

<a herf="www.baidu.com" title="点击进入百度">点击</a>                                      //<a>标签用于实现超链接,herf是点击后的网址,title属性是当鼠标移动到“点击”上面会出现的文字,为文本添加<a>标签之后默认文本会变成蓝色,点击后会变成紫色

         <a herf="网址" target="_blank">点击进入</a>                                                               //点击后在新的浏览器中打开网址(<a>标签默认是在本浏览器中打开,即本页面会被覆盖)

         <a herf="mailto:861923274@qq.com?cc=操送人&bcc=密件操送人&subject=主题&body=内容">发送邮件</a>                             //<a>标签实现点击之后发送邮件,mainto后如果有多个参数,第一个必须加?,后面的每个参数后面加&

         <img src="图片地址" alt="图片加载失败时的替换文本" title="鼠标滑到图片时出现的文字"/>

<form method="传送方式(get/post)"action="用户输入的数据被传送到的地方">                                                                                 //<form>标签用于与用户交互

           <input   type="text时为文本输入框,password时为密码输入框"    name="为文本框命名以便后台程序使用"    value="为本文本输入框设置默认值,一般起到提示作用" />

           <textarea       rows="行数"     cols="列数">多行输入文本框的默认值</textarea>                                                                       //多行文本框输入

 <inputtype="radio/checkbox,当为radio时是单选,checkbox时是多选"  value=""   name="框的名称,同一组按钮name取值一定要一样,这样同一组按钮才能起到单选的作用checked="checked当为checked时默认被选中">               //选择框

<select>                                                                                                                              //下拉列表框进行单选

<option  value="提交值"     selected="selected">选项<option>                 //selected=selected”代表默认被选中

<option >…</option>

</select>

<select   multiple="multiple">                                                                                      //下拉列表框进行多选,设置multiple="multiple"即可进行多选,在windows操作系统下按下Ctrl+左键即可进行多选

<option></option>

</select>

<input type="submit"  value="按钮名称提交"  name=""/>                                                                       //只有type="submit"时,按钮才有提交作用

</form>

 

</body>                                                 

</html>

HTML代码注释

<!--注释文字-->

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值