abstrakt: 首先要對(duì)此項(xiàng)目做一個(gè)布局.將布局放入一個(gè)大的div之中,在div中上方是在線客服的標(biāo)題,下面第一部分是發(fā)送區(qū)內(nèi)容以及客服的相關(guān)回話,第二部分是文本輸入框以及發(fā)送按鍵,通過(guò)css對(duì)樣式進(jìn)行簡(jiǎn)單的布局,再在腳本中獲取相關(guān)的標(biāo)簽.<!DOCTYPE html> <html> <head> <title&
首先要對(duì)此項(xiàng)目做一個(gè)布局.將布局放入一個(gè)大的div之中,在div中上方是在線客服的標(biāo)題,下面第一部分是發(fā)送區(qū)內(nèi)容以及客服的相關(guān)回話,第二部分是文本輸入框以及發(fā)送按鍵,通過(guò)css對(duì)樣式進(jìn)行簡(jiǎn)單的布局,再在腳本中獲取相關(guān)的標(biāo)簽.
<!DOCTYPE html> <html> <head> <title>模擬智能在線客服系統(tǒng)</title> <meta charset="utf-8"> <style type="text/css"> *{margin: 0px;padding: 0px} div:nth-child(1) { width: 450px; height: 650px; background-color: #acf; margin: 30px auto; color: #333 box-shadow: 2px 2px 2px #808080; } h2{ text-align: center; margin-bottom: -10px; font-weight: 400; font-family: 華文琥珀; } div:nth-child(2) { width: 400px; height: 500px; border: 5px double #ff6700; background-color: #efefef; margin: 20px auto 10px; } ul { list-style: none; line-height: 2em; overflow: hidden; padding: 15px; } table { width: 90%; height: 80px; margin: auto; } textarea { border: none; resize: none; background-color: lightyellow; } button { width: 60px; height: 40px; background-color: #F1AD7C; color: #000; border: none; font-family: 幼圓; font-weight: bold; } button:hover { cursor: pointer; background-color: ; color: #fff; } </style> </head> <body> <div> <h2>在線客服</h2> <div contenteditable="true"> <ul> <li></li> </ul> </div> <table> <tr> <td align="right"><textarea cols="50" rows="4" name="text"></textarea></td> <td align="left"><button type="button">發(fā)送</button></td> </tr> </table> </div> <script type="text/javascript"> let btn = document.getElementsByTagName('button')[0]; let text = document.getElementsByName('text')[0]; let list = document.getElementsByTagName('ul')[0]; let sum = 0; </script> </body> </html>
Korrigierender Lehrer:查無(wú)此人Korrekturzeit:2019-03-18 09:46:17
Zusammenfassung des Lehrers:完成的不錯(cuò),邏輯很清晰。做功能就是想著怎么把它拼裝起來(lái)。繼續(xù)加油