HTML之:fieldset——一个不常用的HTML标签
2016年4月14日17:10:02记录
一个不常用的HTML标签fieldset,不过我觉得比较有意思,其语法如下:
<fieldset>
<legend>fieldset名称</legend>
<!-- 加入你的内容 -->
</fieldset>
下面是一个代码示例:
<center>
<fieldset style=" width:300px">
<legend>用户登陆</legend>
<form method="post">
帐号:<input ></input>
<br><br>
密码:<input type="password" ></input>
<br><br>
<input type="submit" value="登陆" ></input>
<input type="reset" value="重填" ></input>
</form>
</fieldset>
</center>
代码的实际效果如下:
fieldset 标签 -- 对表单进行分组
- 此标签是成对出现的,以
<fieldset>
开始,以</fieldset>
结束 - 一个表单可以有多个
<fieldset>
,每对<fieldset>
为一组,每组的内容描述可以使用<legend>
说明
<form action = "http://www.dreamdu.com/dreamdu.php" method = "post" enctype = "multipart/form-data" id = "dreamduform" > <fieldset> <legend> </legend> <input name = "hiddenField" type = "hidden" value = "hiddenvalue" /> <label for = "username" > </label> <input type = "text" id = "username" value = "www.dreamdu.com" /> <label for = "pass" > </label> <input type = "password" id = "pass" /> </fieldset> <fieldset> <legend> </legend> <label for = "boy" > </label> <input type = "radio" value = "1" id = "sex" /> <label for = "girl" > </label> <input type = "radio" value = "2" id = "sex" /> <label for = "sex" > </label> <input type = "radio" value = "3" id = "sex" /> </fieldset> <fieldset> <legend> </legend> <label for = "computer" > </label> <input type = "checkbox" value = "1" id = "fav" /> <label for = "trval" > </label> <input type = "checkbox" value = "2" id = "fav" /> <label for = "buy" > </label> <input type = "checkbox" value = "3" id = "fav" /> </fieldset> <fieldset> <legend> </legend> <label for = "select" > </label> <select size = "1" id = "select" > <option> </option> <option> </option> <option> </option> </select> </fieldset> <fieldset> <legend> </legend> <label for = "multipleselect" > </label> <select size = "10" multiple = "multiple" id = "multipleselect" > <option> </option> <option> </option> <option> </option> <option> </option> <option> </option> <option> </option> <option> </option> <option> </option> <option> </option> </select> </fieldset> <fieldset> <legend> </legend> <label for = "WebDesign" > </label> <select id = "WebDesign" > <optgroup label = "client" > <option value = "HTML" > </option> <option value = "CSS" > </option> <option value = "javascript" > </option> </optgroup> <optgroup label = "server" > <option value = "PHP" > </option> <option value = "ASP" > </option> <option value = "JSP" > </option> </optgroup> <optgroup label = "database" > <option value = "Access" > </option> <option value = "MySQL" > </option> <option value = "SQLServer" > </option> </optgroup> </select> </fieldset> <fieldset> <legend> </legend> <label for = "myimage" > </label> <input type = "file" id = "myimage" size = "35" maxlength = "255" /> <label for = "contactus" > </label> <textarea cols = "50" rows = "10" id = "contactus" > </textarea> </fieldset> <fieldset> <legend> </legend> <input type = "submit" value = "submit" id = "submit" /> <input type = "reset" value = "reset" id = "reset" /> </fieldset> </form>
样式一 代码如下: <fieldset style="width:300;height:150;border:2px groove" align=center></fieldset> 样式二 代码如下: <fieldset style="width:300;height:150;border:2px red groove" align=center></fieldset> 样式三 代码如下: <fieldset style="width:300;height:150;border:2px red groove; </fieldset> 样式四 代码如下: <fieldset style="width:300;height:150;border:1px dashed #ff9966" align="center" > <legend style="border:0px;"> 1234 </legend> </fieldset> 样式五 代码如下: <fieldset style="width:300;height:150;border:1px dashed red" align="center"> <legend style="width:100px;border:1px dashed #ff9966;text-align:center;font-family:arial;font-weight:bold"> 1234 </legend> </fieldset> 样式六 代码如下: <table border=0 cellPadding=0 cellSpacing=0 align="center"> <tr><td bgcolor=#d9d9d9> <fieldset style="width:300;height:150" align=center></fieldset> </td><tr> </table> |
标签:
html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通