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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

留言板制作

發布時間:2024/3/12 编程问答 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 留言板制作 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.在電腦桌面打開DW軟件

2.點擊DW然后創建一個新的布局

3.敲出這些代碼即可

4.在打開html就可以看到效果了

<!DOCTYPE html>

<html lang="en">

<head>

??? <meta charset="UTF-8">

??? <meta http-equiv="X-UA-Compatible" content="IE=edge">

??? <meta name="viewport" content="width=device-width, initial-scale=1.0">

??? <title>留言板</title>

??? <style>

??????? *{

??????????? padding: 0px;

??????????? margin: 0px;

??????? }

??????? .wrap{

??????????? width: 700px;

??????????? height: 500px;

????? ??????background: url(bg2.png);

??????????? margin: 50px auto;

??????????? text-align: center;? /*文字或內容水平居中*/

??????????? overflow: auto;

??????? }

??????? #text{

??????????? width: 300px;

??????????? height: 100px;

??????????? margin-top: 50px;

????????? ??border: 2px solid #666;

??????????? border-radius: 5px;

??????????? resize: none;?

??????????? /* 指定一個元素是否由用戶調整大小*/

??????????? padding: 3%;

??????????? box-sizing: border-box;

??????????? /* 規定容器元素的最終尺寸計算方式 計算padding 和 border??? margin不受影響 */

??????? }

??????? #btn{

??????????? display: block;

??????????? width: 80px;

??????????? height: 30px;

??????????? background-color: skyblue;

??????????? border-radius: 15px;

??????????? color: #fff;

??????????? margin-top: 5px;

??????????? margin-left: 420px;

??????? }

??????? #list{

??????????? width: 300px;

??????????? margin: 15px 0 0 200px;

??????? }

??????? #list li{

??????????? list-style: none;

??????????? width: 300px;

??????????? padding:5px 15px;

??????????? background-color: rgba(3, 141, 141,.5);

??????????? border-radius: 5px;

??????????? color:#fff;

??????????? font-size: 12px;

??????????? text-align: left;

??????????? margin-bottom: 10px;

??????????? box-sizing: border-box;

?? ?????????word-wrap:break-word;? /* 自動換行 */

??????? }

??????? #list li:nth-of-type(even){

??????????? background-color:rgba(226, 62, 33,.5);

??????? }

??? </style>

</head>

<body>

??? <div class="wrap">

??????? <textarea id="text"></textarea>

??????? <button id="btn">留言</button>

??????? <ul id="list">

??????? </ul>

??? </div>

??? <script>

??????? var text = document.getElementById("text");

??????? var btn = document.getElementById("btn");

??????? var list = document.getElementById("list");

??????? btn.onclick = function(){

??????????? var txt = text.value;

??????????? var num = list.getElementsByTagName("li").length+1;?? //獲取到li 的長度并賦值給num;

??????????? if(txt == ""){

??????????????? alert("留言不能為空!")

??? ????????????return;

??????????? }

??????????? list.innerHTML = '<li>'+ num +'樓:' + txt + '</li>' + list.innerHTML;

??????? }

??? </script>

???

</body>

</html>

總結

以上是生活随笔為你收集整理的留言板制作的全部內容,希望文章能夠幫你解決所遇到的問題。

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