fieldset 标签样式自定义

本文介绍如何使用fieldset和legend标签自定义表单样式,并结合Bootstrap框架实现美观的网站后台管理系统界面。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<fieldset>标签标签样式自定义

混搭bootstrap框架,开发网站后台管理系统,结合简单实例,系统界面,截图演示H5标签fieldset、legend的使用效果!

注意:删除代码中的注释部分,就是fieldset单独使用的效果 !

效果预览

这里写图片描述

代码如下:

<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>表格添加fieldset</title>
<!-----------------------------------注释开始--------------------------------------------->
	<!-- Bootstrap -->
    <link href="statics/plugins/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 -->
    <!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<!-----------------------------------注释结束--------------------------------------------->
   
<style type="text/css">
	body{padding: 20px;}
	.bootstrap-elem-field{
	    margin-bottom: 10px;
		padding: 0;
		border-width: 1px;
		border-style: solid;
		border-color: #e6e6e6;
	}
	.bootstrap-elem-field legend {
	    margin-left: 20px;
	    padding: 0 10px;
	    font-size: 20px;
	    font-weight: 300;
	    border-bottom:none;
	    width: auto;
	}
	.bootstrap-field-box{padding: 10px 15px;}
</style>
<!-----------------------------------注释开始--------------------------------------------->
<style type="text/css">
	th,td{text-align: center;}
	th{font-weight: normal;}
	.table>thead:first-child>tr:first-child>th{border-bottom:#ddd solid 1px;}
	.bg-f2f2f2{background: #f2f2f2;}
	.table-hover tbody tr:hover{background-color: #EEEEEE;}
</style>
<!-----------------------------------注释结束--------------------------------------------->
  </head>
  <body>
    <fieldset class="bootstrap-elem-field">
    	<legend>充值记录</legend>
    	<div class="bootstrap-field-box">
<!-----------------------------------注释开始--------------------------------------------->
    		<div class="table-responsive">
				<table class="table table-bordered table-hover">
					<thead>
						<tr class="bg-f2f2f2">
							<th><input type="checkbox" id="selected-all"></th>
							<th>ID</th>
							<th>用户名</th>
							<th>密码</th>
							<th>手机号码</th>
							<th>管理操作</th>
						</tr>
					</thead>
					<tbody>				
						<tr>
							<td><input type="checkbox"></td>
							<td>1</td>
							<td>David</td>
							<td>dp0ogklpa87g3gb</td>
							<td>13356785549</td>
							<td>
								<a href="javascript:;" class="label label-primary">修改</a> 
								<a href="javascript:;" class="label label-danger">删除</a>
							</td>
						</tr>
						
					</tbody>
		
				</table>
			</div>
<!-----------------------------------注释结束--------------------------------------------->
    	</div>
    </fieldset>
    
<!-----------------------------------注释开始--------------------------------------------->
	<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery,所以必须放在前边) -->
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
    <script src="statics/plugins/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-----------------------------------注释结束--------------------------------------------->
  </body>
</html>

以上就是关于“ fieldset标签样式自定义 ” 的全部内容。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

草巾冒小子

你的赞赏,驱动技术分享

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值