DIV CSS 佈局教程網

您现在的位置: DIV+CSS佈局教程網 >> 網頁腳本 >  >> WEB網站前端 >> WEB前端代碼
打造簡潔留言表單:一份可直接套用的 HTML 範本
編輯:WEB前端代碼     

想在自己的網站加入留言功能,第一步就是把「提交留言」的表單做出來。以下提供一份乾淨、易讀的 HTML 範本,適合初學者直接套用與修改。

範本特色

這份表單包含標題、內容與留言者三個輸入欄位,外加一顆提交按鈕,並用簡單的內距與置中樣式讓版面清楚呈現。若你計畫進一步開發完整的留言板(例如以 ASP.NET 實作),這個靜態表單正好可以作為前端起點。

完整程式碼

<!DOCTYPE html>
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
 <title>提交留言-hovertree</title>
</head>
<body>
 <div style="width:800px;margin:10px auto">
 <h2>提交留言</h2>
 <table>
 <tr><td>標題:</td><td><input type="text" style="width:500px" /></td></tr>
 <tr><td>內容:</td><td><textarea style="width:500px;height:200px"></textarea></td></tr>
 <tr><td>留言者:</td><td><input type="text" style="width:500px" /></td></tr>
 <tr><td></td><td><input type="button" value="提交" /></td></tr>
 </table>
 </div>
 <div style="width:800px;margin:10px auto;font-family:Arial, Helvetica, sans-serif;text-align:center;">HoverTree &copy; 2014</div>
</body>
</html>

使用時只要把這段程式碼存成 .htm 或 .html 檔,用瀏覽器打開即可看到表單畫面。後續若要讓表單真正送出資料,再搭配後端程式(如 ASP.NET)串接即可。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved