日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > HTML >内容正文

HTML

前端html小技巧(css篇)—表单美化详解

發布時間:2024/8/1 HTML 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 前端html小技巧(css篇)—表单美化详解 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

今天分享下”前端html小技巧(css篇)—表單美化詳解“這篇文章,文中根據實例編碼詳細介紹,或許對大家的編程之路有著一定的參考空間與使用價值,需要的朋友接下來跟著云南仟龍Mark一起學習一下吧。

一、html submit與bottom按鈕基本語法結構

1、html submit按鈕

在input標簽里設置type="submit"此表單控件可設置為按鈕。

submit按鈕代碼:

代碼如下:

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

submit按鈕效果截圖

html submit按鈕效果截圖

2、html bottom按鈕

在input標簽里設置type="bottom"也是即可設置此表單控件為按鈕。

bottom按鈕代碼:

復制代碼代碼如下:

bottom按鈕截圖:

html botton按鈕效果截圖

二、html submit與bottom按鈕區別

type=button 就單純是按鈕功能

type=submit 是發送表單

但是對于從事WEB UI的人應該要注意到,使用submit來提高頁面易用性:

使用submit后,頁面支持鍵盤enter鍵操作,而很多WEB軟件設計師,可能沒有注意到submit統一.

用button后往往頁面不支持enter鍵了。所以需要支持enter鍵,必須要設置個submit,默認enter鍵對頁面第一個submit進行操作。

復制代碼代碼如下:

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

執行完onClick,轉到action。可以自動提交不需要onClick。所以說onclick這里可以不要。

復制代碼代碼如下:

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

執行完onClick,跳轉文件在 js文件里控制。提交需要onClick。

比如:

1,οnclick=“form1.action=‘a.jsp’;form1.submit();” 這樣就實現了submit的功能了。

2,button代碼

復制代碼代碼如下:

<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>

按鈕截圖

3,按鈕HTML 代碼

復制代碼代碼如下:

<input type=“button” name=“Button” value=“Button”

onClick=“javascript:windows.location.href=“你的url””>

三、html submit與bottom按鈕美化css p布局

首先我們準備好按鈕美化的按鈕圖片,并對input submit或bottom按鈕控件內添加class樣式即可,設置其按鈕背景為美化圖片,設置好邊框為零,寬度和高度。

1、對html bottom按鈕美化

1)、圖片素材

可將圖片另存為使用

美化圖片按鈕素材

2)、對應完整HTML源代碼:

復制代碼代碼如下:

<!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}/* http://www.qlyl1688.com/product_ycxsyw.html */</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='left-36px'"onmouseout="this.style.backgroundPosition='lefttop'"/></div></form></p></body></html>

3)、bottom效果截圖

bottom美化效果截圖

2、對html submit按鈕美化

1)、圖片素材

可將圖片另存為使用

按鈕圖片素材 鼠標右鍵另存為使用

2)、對應完整HTML源代碼:

復制代碼代碼如下:

<!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='left -40px'"onmouseout="this.style.backgroundPosition='left top'" value="提交" /></div></form></p></body></html>

3)、submit按鈕效果截圖

html submit美化后效果截圖

以上是云南仟龍Mark給大家介紹的所有內容,希望對大家有所幫助,如果大家有任何疑問請在腳本之家留言,如果你覺得本文對你有幫助,歡迎轉載,煩請注明出處,謝謝!

總結

以上是生活随笔為你收集整理的前端html小技巧(css篇)—表单美化详解的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。