本文摘自PHP中文网,作者醉折花枝作酒筹,侵删。
在css中,submit的意思是提交,当点击该按钮时,会把用户信息的表单提交到远程数据库中;语法“type="submit"”。type属性可返回确认按钮的表单元素类型,当值为submit时,表示该按钮为确认按钮。

本教程操作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。
Submit对象代表HTML表单中的一个提交按钮(submitbutton)。在HTML表单中<input type="submit">标签每出现一次,一个Submit对象就会被创建。
在表单提交之前,触发onclick事件句柄,并且一个句柄可以通过返回false来取消表单提交。
例子
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | <!DOCTYPE html>
< html >
< head >
< meta charset = "utf-8" />
< title >document</ title >
</ head >
< style >
input[type="text"],
select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type="submit"] {
width: 100%;
background-color: #4caf50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #45a049;
}
div {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}
</ style >
< body >
< h3 >使用 CSS 来渲染 HTML 的表单元素</ h3 >
< div >
< form action = "/action_page.php" >
< label for = "fname" >First Name</ label >
< input
type = "text"
id = "fname"
name = "firstname"
placeholder = "Your name.."
/>
< label for = "lname" >Last Name</ label >
< input
type = "text"
id = "lname"
name = "lastname"
placeholder = "Your last name.."
/>
< label for = "country" >Country</ label >
< select id = "country" name = "country" >
< option value = "australia" >Australia</ option >
< option value = "canada" >Canada</ option >
< option value = "usa" >USA</ option >
</ select >
< input type = "submit" value = "Submit" />
</ form >
</ div >
</ body >
</ html >
|
效果:
![1619515014575402.png 2~]DQ7X1XUCB(RAD[5X6}HX.png](http://ypimg.muzhuangnet.com/Collect/csharp/upload/image/292/138/320/1619515014575402.png)
推荐学习:css视频教程
以上就是css中submit意思是什么的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
css文字颜色渐变的三种实现方式(附代码)
css三种样式表写法是什么
css如何设置表格边框间的距离?border-spacing属性的使用
最受欢迎的10大css框架
已知和未知高度下进行垂直水平居中的方法
input能改变css样式吗
css如何实现按钮透明
css结构化伪类选择器有哪些
npm机制深入理解
值得收藏的26个css面试题,增强你的css基础!
更多相关阅读请进入《css》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » css中submit意思是什么