html常用笔记

时间:2023-03-08 23:25:59
html常用笔记
 <?php
//CSS可以对文本格式进行精确的控制
//HTML标记更有利于搜索引擎 //一、标签
<br>
<p>//换行后插入一个空行,单字节不换行,双字节自动换行
<center>//使内容相对于上一层标记居中对齐
<pre>//保留文字在源代码中的格式
<li>//列表
<ul>//无序列表
<ol type="a"><ol type="A"><ol start="N">//有序列表
<hr>//水平分隔线
<nobr>//不换行
<blockquote>//块引用 两边留白 <h1--h6>//标题标签,自动换行,并插入一空行
<b> <i> <u> <sub> <sup> <tt> <cite> <em> <strong> <small> <big> <font color="red" face="Arial" size="7">文字size7为最大</font> //<body>标签的属性
<body class="" name="" id="" style="" leftmargin="10" topmargin="10" text="yellow" bgcolor="gray" link="red" alink="red" vlink="red" background="image/pic.gif" bgproperties>
//二、描点
<a name="md">描点</a>
<a href="#md">连接到描点</a>
<a href="md.html#md">连接到其它锚点</a> //三、连接
<a href="www.baidu.com" target="_blank" title="凤姐"><img src="./img/fj.jpg"></a>
<a href="mailto:unifyyeteng@126.com">发邮件给我</a> //四、热点区域
<img src="img/fj.jpg" border="0" usemap="#z">
<map name="z">
<area shape="rect" coords="x1,y1,x2,y2" href="http://www.baidu.com" target="_blank">
<area shape="circle" coords="x1,y1,bj" href="http://www.google.com" target="_self">
</map> //五、表格
<table border="0" width="100" height="100" align="center" cellspacing="1" cellspadding="1" bordercolorlight="red" bordercolordark="blue">
<caption>居中</caption>
<tr>
<td align="center" valign="middle" width="" height="" border="" colspan="1" rowspan="1" nowrap="true">//默认不换行只对td生效,如果未设置TD宽度是不生效的 //六、frameset分帧 advert:不要在分帧页面中有任何body标签有关的内容,不然会显示空白,或显示body的内容而不显示分帧
//比如想在左窗口打开右窗口就建一个left.html输入<a href="www.baidu.com" target="ismain">把百度在右窗口打开</a>
//target="_parent"找上一级
//target="_top"找最*,退出分帧
<frameset rows="20%,*" frameborder="0">//1为有边框//0为无边框//或border="n"
<frame src="top.html" name="istop">
<frameset cols="30%,*">
<frame src="left.html" name="isleft">
<frame src="main.html" name="ismain">
</frameset>
</frameset> //iframe分帧 可有body体. advert:对搜索引擎不友好,少用.
<body>
iframe可加body体
<a href="http://www.jike.com" target="baidu">百度</a>
<iframe name="baidu" src="http://www.baidu.com" width="" height="" scrolling="no" noresize></iframe>//scrolling属性:yes.no.auto
</body> //七、表单
//一、action=""或"#"等于提交到当前页
//二、method默认为get代表浏览器传参 post通过header头传参advert:可通过firebug[f12]查看传参内容
<form action="www.baidu.com" method="post">
<input type="text" name="username" value="默认值" maxlength="16" checked readonly disabled>//文本
<input type="password" name="pwd">//密码
<input type="hidden" name="hid" value="隐藏值">//隐藏 <input type="radio" name="sex" value="0" id="n"><label for="n">男</label>//单选,name要相同,否则会成多选.
<input type="radio" name="sex" value="1" id="v"><label for="v">女</label> <input type="checkbox" name="sz[]" value="0">朋友介绍//多选,以数组方式提交
<input type="checkbox" name="sz[]" value="1">细说php <select name="li" size="n" multiple>//列表//size默认1//multiple不赋值,加入后可多选.
<option value="0" selected>内容</option>//selected默认选中
<option value="1">内容</option>
<option>内容</option>//无值则提交内容
</select> <textarea name="area" rows="2" cols="10">这里填写默认值</textarea>//内容文本框//标签中间不能有空格回车 <input type="image" src="xx.jpg">//图片按钮
<input type="button" name="a" value="无提交效果">//无提交效果按钮
<input type="submit" name="sub" value="提交">//提交 advert:按回车不提交value值,必须按按钮
<input type="reset" value="重填">//重填 <input type="file" name="f">//单文件上传
<input type="file[]" name="fs">//多文件上传 //八、mata标签
<mata http-equiv="Content-type" content="text/html;charset=utf-8">//字符集
<mata http-equiv="Refresh" content="1"; url="http://www.baidu.com">//刷新后过N秒转到指定网页
<meta http-equiv="page-exit" content="revealtrans(duration=3,transition=17)">//关闭效果,在火狐上无效
<mata name="keywords" content="php培训,php招生,php视频,php视频教程">//关键字
<mata name="Description" content="lamp兄弟连为大家提供最佳专业的php视频,php免费视频,php教学">//描述,介绍
<mata name="robots" content="">//是否准许机器人抓取,详细百度查baidu.现在一般用robots.txt 比如:http://www.baidu.com/robots.txt
<mata name="Generator" content="lamp兄弟连php专用工具">//
<mata name="Author" content="php开发小组">
<mata name="Copyright" content="lamp兄弟连php小组版权所有"> //九、base标签
<base target="_blank">//代表本页所有连接均以_blank方式打开 <base href="http://www.baidu.com">//这代表下面的连接的根
<img src="img/baidu.jpg">会变为 http://www.baidu.com/img/baidu.jpg
<a href="a/n.html">a</a>会变为 http://www.baidu.com/a/n.html
//十、div和span标签
div只有换行效果
span无任何效果