HTML静态网页 图片热点、框架、表单

图片热点:

  规划出图片上的一个区域,可以做出超链接,直接点击图片区域就可以完成跳转的效果。

示例:

网页划区:

  在一个网页里,规划出一个区域用来展示另一个网页的内容。

示例:

框架:

1.frameset

  frameset最外层,使用时需要去除body改用frameset。

<frameset  rows="100,*" frameborder="no">--上下分,第一行100像素,剩余为第二行,rows换成cols,则变为左右分。frameborder=“no”,去掉分割线。

<frame src="页面地址" noresize="noresize">--noresize,禁止调整窗口大小。

<frame src="" scrolling="no">--scrolling="no",取消显示滚动条。

</frameset>

网页的拼接示例::

  在一个网络页面内,规划出多个页面窗口,以表格拼接的形式展示出来。

  在超链接指定目标页面显示在哪个框架窗口中

第一步:给要显示内容的目标frame设置name属性

第二部:给超链接的target属性赋值成第一步设置的name

让整个frameset页面跳转至某个页面:

把超链接的target属性设置为"_top"。

2.iframe

  在原来的页面嵌入小窗口以显示其他的页面

  <iframe src="其他页面的地址" width="" height="" frameborder="0" scrolling="no"></iframe>

  frameborder,边线;scrolling,滚动条。如果设置高和宽度为0,则不显示,但是在后台会存有这么一个页面,例如熊猫烧香病毒。

表单:

<form id="" name="" method="post/get" action="负责处理的服务端">

id不可重复,name可重复,get提交有长度限制,并且编码后的内容在地址栏可见,

post提交没有长度限制,且编码后内容不可见。

</form>

1.文本输入

  文本框<input type="txt" name="" id="" value="" />

  密码框<input type="password" name="" id="" value="" />

  文本域<textarea name="" id="" cols=""(字符多少) rows=""(几行高)></textarea>

  隐藏域<input type="hidden" name="" id="" value="" />

2.按钮

  提交按钮<input type="submit" name="" id="" disabled="disabled" value="" />点击后转到form内的提交服务器的地址

  重置按钮<input type="reset" name="" id="" disabled="disabled" value="" />

  普通按钮<input type="button" name="" id="" disabled="disabled" value="" />

  图片按钮<input type="image" name="" id="" disabled="disabled" src="图片地址" />

  disabled使按钮失效

  enable使按钮可用

3.选择输入

  单选按钮组<input type="redio" name="" checked="checked" value="" />

  name的值用来分组,value的值看不见,提交给程序用的,checked设置默认选项。

  复选框组<input type="checkbox" name="" checked="checked" value="" />

  文件上传<input type="file" name="" id="" />

  <lable for=""></lable>

  lable标签为input元素定义标注。

  lable元素不会向用户呈现任何特殊效果,不过,他为鼠标用户改进了可用性。如果您在lable元素内点击文本,就会触发此控件。

  就是说,当用户选择该标签时,浏览器会 将焦点转到和标签相关的表单控件上。

  lable标签的for属性应当与相关元素的id属性相同。

4.下拉列表框

  <select name="" id="" size="" multiple="multiple">

  --size为1时,为菜单;>1时,为列表。multiple为多选。

    <option value="值">内容1</option>

    <option value="值" selected="selected">内容2</option>

    --selected,设为默认

    <option value="值">内容3</option>

  </select>

 

练习:

<body background="../../Documents/Pictures/新建文件夹/未标题-1.jpg">

<table width="500" height="500" border="0">
<tr>
<td width="100" height="20">邮箱:</td>
<td width="100"><form id="form1" name="form1" method="post" action="">
  <p><input type="text" name="first" id="" value=""/></p>
</form></td>
</tr>

<tr>
<td height="20"> </td>
<td><form id="form2" name="form2" method="post" action="">
<font color="#CCCCCC" size="-1">需要通过邮箱激活账户,不支持sohu,21cn,sogou的邮箱
</font></form></td>
</tr>

<tr>
<td width="100" height="20">登录用户名:</td>
<td width="100"><form id="form3" name="form3" method="post" action="">
<p>  
   <input type="text" name="first" id="" value=""/>
</p>
</form></td>
</tr>

<tr>
<td height="20"> </td>
<td><form id="form4" name="form4" method="post" action="">
<font color="#CCCCCC" size="-1">仅在登录时使用,字符数不少于4个
</font></form></td>
</tr>

<tr>
<td width="100" height="20">显示名称:</td>
<td width="100"><form id="form5" name="form5" method="post" action="">
<p>  
   <input type="text" name="first" id="" value=""/>
</p>
</form></td>
</tr>

<tr>
<td height="20"> </td>
<td><form id="form6" name="form6" method="post" action="">
<font color="#CCCCCC" size="-1">即昵称,字符数不少于2个
</font></form></td>
</tr>

<tr>
<td width="100" height="20">密码:</td>
<td width="100"><form id="form7" name="form7" method="post" action="">
<p>  
   <input type="password" name="first" id="" value=""/>
</p>
</form></td>
</tr>

<tr>
<td width="100" height="20">确认密码:</td>
<td width="100"><form id="form8" name="form8" method="post" action="">
<p>  
   <input type="password" name="first" id="" value=""/>
</p>
</form></td>
</tr>

<tr>
<td height="20"> </td>
<td><form id="form9" name="form9" method="post" action="">
<font color="#CCCCCC" size="-1">至少8位,必须包含字母、数字、特殊字符
</font></form></td>
</tr>

<tr>
<td width="100" height="60">性别:</td>
<td width="100"><form id="form10" name="form10" method="post" action="">
  <select name="down" size="1">
  <option values="">男</option>
  <option values="">女</option>
</select></form></td>
</tr>

<tr>
<td width="100" height="30">喜好:</td>
<td width="100"><form id="form11" name="form11" method="post" action="">
  <select name="down" size="1">
  <option values="">听音乐</option>
  <option values="">唱歌</option>
  <option values="">打篮球</option>
  <option values="">看书</option>
</select></form></td>
</tr>

<tr>
<td height="100"> </td>
<td><form id="form12" name="form12" method="post" action="">
   <input type="submit" name="button" id="button" value="注册"/>  
   <input type="reset" name="button" id="button" value="重置"/>
</form></td>
</tr>
</table>
</body>

 

快速制作网页的方法:

  利用Photoshop中的切片工具来规划出要设置链接的位置,设置好后存储为web可使用的html格式。

用DREAMWEAVER打开,打开设计页面,选择切片弄好的位置,在属性中输入超链接的网址即可。

原文地址:https://www.cnblogs.com/jiangshuai52511/p/5007702.html