HTML <form>表单加外边框

作者:CYL

日期:2020-10-11

标签 form 表单 加框

问题:现在 已有的HTML代码是

	<form action="form_action.asp" method="get">
		<p>First name: <input type="text" name="fname" /></p>
		<p>Last name: <input type="text" name="lname" /></p>
		<input type="submit" value="Submit" />
	</form>

对应的图为在这里插入图片描述
但是现在我想要给该表单加上一个外边框
变成下图这样在这里插入图片描述
那么更改代码为:

	<form action="form_action.asp" method="get">
		<fieldset>  <!--加外边框-->
			<p>First name: <input type="text" name="fname" /></p>
			<p>Last name: <input type="text" name="lname" /></p>
			<input type="submit" value="Submit" />
		</fieldset>
	</form>

如果想要给外边框加上一个名字
那么在中加上一个标签即可
在这里插入图片描述

	<form action="form_action.asp" method="get">
		<fieldset>  <!--加外边框-->
			<legend>注册表单</legend>
			<p>First name: <input type="text" name="fname" /></p>
			<p>Last name: <input type="text" name="lname" /></p>
			<input type="submit" value="Submit" />
		</fieldset>
	</form>
注:HTML需要记的标签太多了 一老忘
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>Login</class> <widget class="QWidget" name="Login"> <property name="windowModality"> <enum>Qt::ApplicationModal</enum> </property> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>652</width> <height>385</height> </rect> </property> <property name="windowTitle"> <string>图书馆管理系统</string> </property> <widget class="QLabel" name="label"> <property name="geometry"> <rect> <x>20</x> <y>20</y> <width>111</width> <height>41</height> </rect> </property> <property name="text"> <string><html><head/><body><p><span style=" font-size:16pt;">用户登录</span></p></body></html></string> </property> <property name="textFormat"> <enum>Qt::AutoText</enum> </property> </widget> <widget class="QLabel" name="user"> <property name="geometry"> <rect> <x>150</x> <y>90</y> <width>60</width> <height>41</height> </rect> </property> <property name="text"> <string><html><head/><body><p><span style=" font-size:12pt;">用户名</span></p></body></html></string> </property> </widget> <widget class="QLabel" name="password"> <property name="geometry"> <rect> <x>160</x> <y>150</y> <width>60</width> <height>26</height> </rect> </property> <property name="text"> <string><html><head/><body><p><span style=" font-size:12pt;">密码</span></p></body></html></string> </property> </widget> <widget class="QLabel" name="identify"> <property name="geometry"> <rect> <x>140</x> <y>180</y> <width>91</width> <height>59</height> </rect> </property> <property name="text"> <string><html><head/><body><p><span style=" font-size:12pt;">身份类型</span></p></body></html></string> </property> </widget> <widget class="QLineEdit" name="userline"> <property name="geometry"> <rect> <x>290</x> <y>100</y> <width>191</width> <height>21</height> </rect> </property> </widget> <widget class="QLineEdit" name="pwline"> <property name="geometry"> <rect> <x>290</x> <y>150</y> <width>191</width> <height>21</height> </rect> </property> <property name="echoMode"> <enum>QLineEdit::Password</enum> </property> </widget> <widget class="QComboBox" name="idbox"> <property name="geometry"> <rect> <x>320</x> <y>200</y> <width>121</width> <height>22</height> </rect> </property> <item> <property name="text"> <string>读者</string> </property> </item> <item> <property name="text"> <string>图书管理员</string> </property> </item> <item> <property name="text"> <string>系统管理员</string> </property> </item> </widget> <widget class="QPushButton" name="loginbt"> <property name="geometry"> <rect> <x>250</x> <y>270</y> <width>93</width> <height>28</height> </rect> </property> <property name="text"> <string>登录</string> </property> </widget> <widget class="QPushButton" name="exitbt"> <property name="geometry"> <rect> <x>420</x> <y>270</y> <width>93</width> <height>28</height> </rect> </property> <property name="text"> <string>退出</string> </property> </widget> </widget> <resources/> <connections/> </ui> 美化UI
最新发布
05-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

中南大学苹果实验室

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值