学C#的第18天(下)

森岩
2022-08-09 / 0 评论 / 1 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2022年08月09日,已超过1215天没有更新,若内容或图片失效,请留言反馈。

1、HTML表单(form)

1. 元素:

  1. 单行文本输入框(TEXT)
  2. 密码框(PASSWORD)
  3. 单选按钮(RADIO)
  4. 复选框(CHECKBOX)
  5. 下拉列表(SELECT)
  6. 重置按钮(RESET)
  7. 提交按钮(SUBMIT)
  8. 多行文本框(TEXTAREA)

2. 属性:

1. form属性:

  1. action:表单要提交到的网址
  2. method:表单提交的方式

2. input属性:

  1. type:类型(元素)
  2. name:名字
  3. value:显示的文本

3. 范例:

        <form action="http://www.baidu.com" method="get">
            用户名:<input type="text" name="txtName"/><br/>
            密码:<input type="password" name="txtPwd"/><br/>
            <input type="submit" value="提交到百度"/>
            <input type="reset" value="清空"/><br/>
            <fieldset>
                <legend>性别</legend>
                <input type="radio" name="sex"/>男<br/>
                <input type="radio" name="sex"/>女<br/>
            </fieldset>
            <fieldset>
                <legend>婚姻状况</legend>
                <input type="radio" name="married"/>已婚<br/>
                <input type="radio" name="married"/>未婚<br/>
            </fieldset>
            <select>
                <optgroup label="湖北省">
                    <option>武汉</option>
                    <option>黄冈</option>
                    <option>黄石</option>
                    <option>十堰</option>
                </optgroup>
                <optgroup label="湖南省">
                    <option>长沙</option>
                    <option>岳阳</option>
                    <option>衡阳</option>
                    <option>益阳</option>
                </optgroup>
            </select>
            <br/>
            <input type="file"/><br/>
            <textarea cols="20" rows="3">
                123123
            </textarea>
        </form>

2、Div+Span

  1. Div独占一个层,一般用来给网页划分区域
  2. Span不独占一层,一般用来改变字体样式

3、HTML页面框架

1. 构成

  1. 框架页面使用frameset代替body
  2. 例子:
<html>
    <head>
        <title></title>
    </head>
    <frameset rows="10%,*">
        <frame src="top.html" noresize="noresize"/>
        <frameset cols="50%,*">
            <frame src="left.html" noresize="noresize"/>
            <frame src="right.html" name="Right"/>
        </frameset>
    </frameset>
</html>

2.实现在同一框架页面下,点击其中一个页面的超链接,在另一个页面打开网页

  1. 在想要放超链接的页面上写超链接
  2. 在超链接上写target
  3. 在框架页面中,把对应的另一个页面改名
  4. 例子(结合上面的代码):
<a href="http://www.baidu.com" target="Right">百度</a>
0

评论

博主关闭了所有页面的评论