ဘယ်လိုကြိုးပမ်း: ဆက်သွယ်ဆိုင်ရာ ဖွင့်ပေးရန်
ဘယ်လိုကြိုးပမ်းရန် ဆက်သွယ်ဆိုင်ရာ ဖွင့်ပေးရန် CSS နှင့် JavaScript ကို သင်တော်မူပါ။
စက်ကို ဖွင့်ပြီး ဆက်သွယ်ဆိုင်ရာ ဖွင့်ရန် ဘယ်လိုကြိုးပမ်းလဲ့?
ပထမအစိတ် - စက်ကို ထပ်ထည့်ပေးရန် HTML:
အသုံးပြုပြီး <form> အရာကို ပြီး သင်တော်မူ ပြီး ပြင်းပြင်းထန်ထန် အချက်အလက်များ ကို သင်တော်မူ နိုင်ပါသည်。
<div class="chat-popup" id="myForm"> <form action="/action_page.php" class="form-container"> <h1>ဆက်သွယ်ဆိုင်ရာ</h1> <label for="msg"><b>အမှတ်ပြု</b></label> <textarea placeholder="အမှတ်ပြုပြီး အမှန်ပြောဆိုပါ..." name="msg" required></textarea> <button type="submit" class="btn">ပေးပို့</button> <button type="button" class="btn cancel" onclick="closeForm()">ပိတ်ရန်</button> </form> </div>
ဒုတိယအစိတ် - စက်ကို ထပ်ထည့်ပေးရန် CSS:
{box-sizing: border-box;} /* ဆက်သွယ်ဆိုင်ရာ ပေါင်းစား စက်ကို ဖွင့်ပေးသော ဘေ့လ်ပ် - စားပြီး ပုံစံတွင် ချဲ့ချဲ့ချဲ့ */ .open-button { background-color: #555; color: white; padding: 16px 20px; border: none; cursor: pointer; opacity: 0.8; position: fixed; bottom: 23px; right: 28px; width: 280px; } /* စက်ကိုကူးပြီး ဆက်သွယ်ဆိုင်ရာ ဝတ်ရာဒေါင် လျှောက်ချက် */ .chat-popup { display: none; position: fixed; bottom: 0; right: 15px; border: 3px solid #f1f1f1; z-index: 9; } /* ပမတ်ပြုရာအဆိုပါဂုဏ်ငွေ့အော်စ်အာ� ပြုပြင်ပါ */ .form-container { max-width: 300px; padding: 10px; background-color: white; } /* အရှည်ကို ပိုက်ချင်းပြုပါ */ .form-container textarea { width: 100%; padding: 15px; margin: 5px 0 22px 0; border: none; background: #f1f1f1; resize: none; min-height: 200px; } /* အခြားအကြောင်းအရာပြုလုပ်ပါ */ .form-container textarea:focus { background-color: #ddd; outline: none; } /* တောင်းပန်/မှတ်ချက်ပြုရာအဆိုပါဂုဏ်ငွေ့အော်စ်အား ပြုပြင်ပါ */ .form-container .btn { background-color: #04AA6D; color: white; padding: 16px 20px; border: none; cursor: pointer; width: 100%; margin-bottom:10px; opacity: 0.8; } /* ပယ်ဖျက်နှိပ်ချက်အား အပိုးအဖြူရောင်သုံးပါ */ .form-container .cancel { background-color: red; } /* နှိပ်ချက်အား အကြောင်းအရာပြုလုပ်ပါ */ .form-container .btn:hover, .open-button:hover { opacity: 1; }
တတိယပိုင်း - ဂျာမည့်ဂုဏ်ငွေ့ပြုလုပ်ပါ:
function openForm() { document.getElementById("myForm").style.display = "block"; } function closeForm() { document.getElementById("myForm").style.display = "none"; }
相关页面
教程:HTML 表单
教程:CSS 表单