search
HomeWeb Front-endCSS TutorialUse css to beautify html form controls (form beautification) detailed example

1. Basic syntax structure of html submit and bottom buttons

1. html submit button

Set type="submit" in the input tag to set this form control to button.

submit button code:

The code is as follows:

<input name="" type="submit" value="提交" />

submit button effect screenshot

Use css to beautify html form controls (form beautification) detailed example

html submit button effect screenshot

2. HTML bottom button

Set type="bottom" in the input tag to set this form control as a button.

bottom button code:


The code is as follows:

<input name="" type="button" value="提交" />

bottom button screenshot:

Use css to beautify html form controls (form beautification) detailed example

html botton button effect screenshot

2. The difference between html submit and bottom button

type=button is simply a button function

type=submit is to send the form

But those who are engaged in WEB UI should note that using submit to improve the usability of the page:

After using submit, the page supports keyboard enter key operation, and many WEB software designers, You may not have noticed that submit is unified.

After using the button, the page often does not support the enter key. Therefore, if you need to support the enter key, you must set up a submit. By default, the enter key operates on the first submit on the page.

The code is as follows:

<input type="submit" name="b1" value="提交" onClick="bt_submit_onclick()">

After executing onClick, go to action. Can be submitted automatically without onClick. So onclick is not required here.


The code is as follows:

<input type="button" name="b1" value="提交" onClick="bt_submit_onclick()">

After onClick is executed, the jump file is controlled in the js file. Submit requires onClick.

For example:

1, onclick="form1.action='a.jsp';form1.submit();" This realizes the submit function .

2, button code

The code is as follows:

<form name="form1" method="post" action="<a href="http://www.css.com">http://www.css.com</a>"> 
<input type="button" name="Button" value="按钮" onClick="submit()"> 
</form>

Use css to beautify html form controls (form beautification) detailed example

Button screenshot

3,Button HTML code

The code is as follows:

<input type="button" name="Button" value="Button"
onClick="javascript:windows.location.href="你的url"">

3. HTML submit and bottom button beautification css p layout

First we prepare the button image for button beautification, and modify the input submit or bottom button control Just add a class style, set the button background to beautify the picture, set the border to zero, width and height.

1. Beautify the html bottom button

1), picture material

You can save the picture as using

Use css to beautify html form controls (form beautification) detailed example

Beautify picture button material

2), corresponding complete HTML source code:

The code is as follows:

<!DOCTYPE html>
<html>
<head>
<title>button按钮美化在线演示-www.css.com</title>
<style>
html{width:100%;height:100%;}
body{background:#fff;font-size:18px;font-family:"Arial","Tahoma","微软雅黑","雅黑";
line-height:18px;padding:0px;margin:0px;text-align:center}
div{padding:18px}
img{border:0px;vertical-align:middle;padding:0;margin:0}
input,button{font-family:"Arial","Tahoma","微软雅黑","雅黑";border:0;
vertical-align:middle;margin:8px;line-height:18px;font-size:18px}
.btn{width:140px;height:36px;line-height:18px;font-size:18px;
background:url("bg26.jpg")no-repeatlefttop;color:#FFF;padding-bottom:4px}
</style>
</head>
<body>
<p>
<formid="form1"name="form1"method=""action="<a href="http://www.css.com/"target="_blank">http://www.css.com/"target="_blank</a>">
<div>
<inputtype="button"class="btn"value="按钮"onmouseover="this.style.backgroundPosition=&#39;left-36px&#39;"
onmouseout="this.style.backgroundPosition=&#39;lefttop&#39;"/>
</div>
</form>
</p>
</body>
</html>



3), bottom effect screenshot

Use css to beautify html form controls (form beautification) detailed example

bottom beautification effect screenshot

2. Beautify the html submit button

1), picture material

can be used to Save as using

Use css to beautify html form controls (form beautification) detailed example

button image material right click and save as using

2), corresponding to the complete HTML source code:

The code is as follows:

<!DOCTYPE html> 
<html> 
<head> 
<title>submit按钮美化 在线演示-www.css.com</title> 
<!-- <a href="http://www.css.com">www.css.com</a> --> 
<style> 
html { width:100%; height:100%; } 
body { background:#fff; font-size:18px; font-family:"Arial", "Tahoma", "微软雅黑", "雅黑";
line-height:18px; padding:0; margin:0; text-align:center; } 
div { padding:18px } 
img { border:0px; vertical-align:middle; padding:0px; margin:0px; } 
input, button { font-family:"Arial", "Tahoma", "微软雅黑", "雅黑"; border:0;
vertical-align:middle; margin:8px; line-height:18px; font-size:18px } 
.btns { width:143px; height:40px; background:url("bg11.jpg") no-repeat left top; color:#FFF; } 
</style> 
</head> 
<body> 
<p> 
<form id="form1" name="form1" method="" action="<a href="http://www.css.com/">http://www.css.com/</a>" target="_blank"> 
<div> 
<input type="submit" class="btns" onmouseover="this.style.backgroundPosition=&#39;left -40px&#39;"
onmouseout="this.style.backgroundPosition=&#39;left top&#39;" value="提交" /> 
</div> 
</form> 
</p> 
</body> 
</html>

3), screenshot of submit button effect

Use css to beautify html form controls (form beautification) detailed example

html screenshot of submit beautification effect

More uses css to beautify html form controls ( Form beautification) For detailed examples and related articles, please pay attention to the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Creating a Reusable Pagination Component in VueCreating a Reusable Pagination Component in VueApr 22, 2025 am 11:17 AM

The idea behind most of web applications is to fetch data from the database and present it to the user in the best possible way. When we deal with data there

Using 'box shadows' and clip-path togetherUsing 'box shadows' and clip-path togetherApr 22, 2025 am 11:13 AM

Let's do a little step-by-step of a situation where you can't quite do what seems to make sense, but you can still get it done with CSS trickery. In this

All About mailto: LinksAll About mailto: LinksApr 22, 2025 am 11:04 AM

You can make a garden variety anchor link () open up a new email. Let's take a little journey into this feature. It's pretty easy to use, but as with anything

It's pretty cool how Netlify CMS works with any flat file site generatorIt's pretty cool how Netlify CMS works with any flat file site generatorApr 22, 2025 am 11:03 AM

Little confession here: when I first saw Netlify CMS at a glance, I thought: cool, maybe I'll try that someday when I'm exploring CMSs for a new project. Then

Testing for Visual Regressions with PercyTesting for Visual Regressions with PercyApr 22, 2025 am 11:02 AM

It’s a Herculean task to test

Edge Goes Chromium: What Does it Mean for Front-End Developers?Edge Goes Chromium: What Does it Mean for Front-End Developers?Apr 22, 2025 am 10:58 AM

In December 2018, Microsoft announced that Edge would adopt Chromium, the open source project that powers Google Chrome. Many within the industry reacted with

A Gutenburg-Powered NewsletterA Gutenburg-Powered NewsletterApr 22, 2025 am 10:57 AM

I like Gutenberg, the new WordPress editor. I'm not oblivious to all the conversation around accessibility, UX, and readiness, but I know how hard it is to

Using  for Menus and Dialogs is an Interesting IdeaUsing for Menus and Dialogs is an Interesting IdeaApr 22, 2025 am 10:56 AM

Using for a menu may be an interesting idea, but perhaps not something to actually ship in production. See "More Details on "

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment