စာရင်းတင်ပုံစံ ကို မူကြမ်းယူပါ :

CSS ကို အသုံးပြု၍ အတူတူသော စာရင်းတင်ပုံစံ ကို ပြုလုပ်ပါ :

ဘေ့လုံးကို ဖွင့်ပေးရန် သတ်မှတ်ပါ :

亲自试一试

စာရင်းတင်ပုံစံ ကို မူကြမ်းယူပါ :

ပထမဆုံးအဆင့် - အခြေခံ HTML ထပ်ပေးပါ :

အသုံးပြု <form> အစားအစာကို ဖြင့် တိုက်ရိုက် ပြီး ကျွန်ုပ်၏ PHP ဖော်ပြချက်များ တွင် ပိုမိုသိနိုင်သည်။

အကြောင်းအရာတစ်ခုခုအတွက် တိုက်ရိုက် အရေးပါသော တည်ရိုက်ခြင်း အသုံးပြုပြီး (တူညီသော ဂရောသံကို ပါဝင်သည်) :

<form action="action_page.php" style="border:1px solid #ccc">
  <div class="container">
    <h1>မှတ်ချက်ပြုရန်</h1>
    <p>ဒီ ပြုပြင်မှု ကို ဖွဲ့စည်းလုပ်ပါက အကောက်စာ ကို ဖွဲ့စည်းလုပ်ပါ</p>
    <hr>
    <label for="email"><b>အိမ်ရှယ်</b></label>
    <input type="text" placeholder="Enter Email" name="email" required>
    <label for="psw"><b>ပြည့်စား</b></label>
    <input type="password" placeholder="Enter Password" name="psw" required>
    <label for="psw-repeat"><b>ပြန်လည် ပြည့်မျှတ် ပြည့်စား</b></label>
    <input type="password" placeholder="Repeat Password" name="psw-repeat" required>
    <label>
    <input type="checkbox" checked="checked" name="remember" style="margin-bottom:15px">ကျန်းမာသည်
    </label>
    <p>ဒီ အကောက်စာ ကို ဖွဲ့စည်းလုပ်ပါက ကျွန်တော်တို့၏ <a href="#" style="color:dodgerblue">အခြေခံ အကြံပေးချက် နှင့် လျို့ဝှက်</a> ကို သဘောတူသွားပါ</p>
    <div class="clearfix">
      <button type="button" class="cancelbtn">ပယ်ဖျက်</button>
      <button type="submit" class="signupbtn">စာရင်းတင်</button>
    </div>
  </div>
</form>

第二步 - 添加 CSS:

* {box-sizing: border-box}
/* အကွန်ပိုင်းအား ကျယ်ပြီး အသုံးပြု */
  input[type=text], input[type=password] {
  width: 100%;
  padding: 15px;
  margin: 5px 0 22px 0;
  display: inline-block;
  border: none;
  background: #f1f1f1;
}
input[type=text]:focus, input[type=password]:focus {
  background-color: #ddd;
  outline: none;
}
hr {
  border: 1px solid #f1f1f1;
  margin-bottom: 25px;
}
/* 为所有按钮设置样式 */
button {
  background-color: #04AA6D;
  color: white;
  padding: 14px 20px;
  margin: 8px 0;
  border: none;
  cursor: pointer;
  width: 100%;
  opacity: 0.9;
}
button:hover {
  opacity:1;
}
/* 设置取消按钮的额外样式 */
.cancelbtn {
  padding: 14px 20px;
  background-color: #f44336;
}
/* ပယ်ဖျက် နှင့် စာရင်းတင် ဘေ့လုံး ကို ပျံ့နှံ့ပြီး အတူတူသော အကွန်ပိုင်းအဆင်းအား ထပ်ပေး */
.cancelbtn, .signupbtn {
  float: left;
  width: 50%;
}
/* အကွန်ပိုင်းအဆင်းအား အကွန်ပိုင်းအဆင်းအား ထပ်ပေး */
.container {
  padding: 16px;
}
/* တောင်ပြားကို ဖျက်သိမ်း */
.clearfix::after {
  content: "";
  clear: both;
  display: table;
}
/* အနည်းဆုံး အကျယ်အဝန်း ၃၀၀ပမာဏ အထိ ဖြင့် ဖြေဖြူမှု */
@media screen and (max-width: 300px) {
  .cancelbtn, .signupbtn {
    width: 100%;
  }
}

亲自试一试

အမှုထမ်း စာရင်းတင်ပုံစံ ကို မူကြမ်းယူပါ :

ပထမဆုံးအဆင့် - အခြေခံ HTML ထပ်ပေးပါ :

အသုံးပြု <form> အစားအစာကို ဖြင့် တိုက်ရိုက် ပြီး ကျွန်ုပ်၏ PHP ဖော်ပြချက်များ တွင် ပိုမိုသိနိုင်သည်။

အကြောင်းအရာတစ်ခုခုအတွက် တိုက်ရိုက် အရေးပါသော တည်ရိုက်ခြင်း အသုံးပြုပြီး (တူညီသော ဂရောသံကို ပါဝင်သည်) :

<!-- အမှုထမ်းဖွင့်ပေးသော ဘေ့လုံး -->
<button onclick="document.getElementById('id01').style.display='block'">စာရင်းတင်</button>
<!-- တူညီသော အမှုထမ်း (အင်တာဗျူး စာရင်းတင်ပုံစံကို ပါဝင်သည်) -->
<div id="id01" class="modal">
  <span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">သတ်မှတ်ကြ;</span>
  <form class="modal-content" action="/action_page.php">
    <div class="container">
      <h1>မှတ်ချက်ပြုရန်</h1>
      <p>ဒီ ပြုပြင်မှု ကို ဖွဲ့စည်းလုပ်ပါက အကောက်စာ ကို ဖွဲ့စည်းလုပ်ပါ</p>
      <hr>
      <label for="email"><b>အိမ်ရှယ်</b></label>
      <input type="text" placeholder="Enter Email" name="email" required>
      <label for="psw"><b>ပြည့်စား</b></label>
      <input type="password" placeholder="Enter Password" name="psw" required>
      <label for="psw-repeat"><b>ပြန်လည် ပြည့်မျှတ် ပြည့်စား</b></label>
      <input type="password" placeholder="Repeat Password" name="psw-repeat" required>
      <label>
        <input type="checkbox" checked="checked" name="remember" style="margin-bottom:15px"> ကျန်းမာသင်
      </label>
      <p>ဒီ အကောက်စာ ကို ဖွဲ့စည်းလုပ်ပါက ကျွန်တော်တို့၏ <a href="#" style="color:dodgerblue">အခြေခံ အကြံပေးချက် နှင့် လျို့ဝှက်</a> ကို သဘောတူသွားပါ</p>
      <div class="clearfix">
        <button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">သန့်စင်</button>
        <button type="submit" class="signup">Sign Up</button>
      </div>
    </div>
  </form>
</div>

第二步 - 添加 CSS:

* {box-sizing: border-box}
/* Full-width input fields */
  input[type=text], input[type=password] {
  width: 100%;
  padding: 15px;
  margin: 5px 0 22px 0;
  display: inline-block;
  border: none;
  background: #f1f1f1;
}
/* 当输入框获得焦点时添加背景颜色 */
input[type=text]:focus, input[type=password]:focus {
  background-color: #ddd;
  outline: none;
}
/* 为所有按钮设置样式 */
button {
  background-color: #04AA6D;
  color: white;
  padding: 14px 20px;
  margin: 8px 0;
  border: none;
  cursor: pointer;
  width: 100%;
  opacity: 0.9;
}
button:hover {
  opacity:1;
}
/* 设置取消按钮的额外样式 */
.cancelbtn {
  padding: 14px 20px;
  background-color: #f44336;
}
/* 使取消和注册按钮浮动并设置相等的宽度 */
.cancelbtn, .signupbtn {
  float: left;
  width: 50%;
}
/* 向容器元素添加内边距 */
.container {
  padding: 16px;
}
/* 模态(背景) */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: #474e5d;
  padding-top: 50px;
}
/* ပုံမှား အသွင် */
.modal-content {
  background-color: #fefefe;
  margin: 5% auto 15% auto; /* အထပ် ၅% နှင့် အောက် ၁၅% အထိ အရှိန်ထိန်းပေးပါ */
  border: 1px solid #888;
  width: 80%; /* အကျယ်အဝန်း ၈၀% ဖြင့် ဖြစ်နိုင် သို့မဟုတ် အခြား */
}
/* ရှိတ်အစင် ဖြင့် ဖြေဖြူမှု */
hr {
  border: 1px solid #f1f1f1;
  margin-bottom: 25px;
}
/* ပိတ်စာကြိုး (x) */
.close {
  position: absolute;
  right: 35px;
  top: 15px;
  font-size: 40px;
  font-weight: bold;
  color: #f1f1f1;
}
.close:hover,
.close:focus {
  color: #f44336;
  cursor: pointer;
}
/* Clear floats */
.clearfix::after {
  content: "";
  clear: both;
  display: table;
}
/* အနည်းဆုံး အကျယ်အဝန်း ၃၀၀ပမာဏ အထိ ဖြင့် ဖြေဖြူမှု */
@media screen and (max-width: 300px) {
  .cancelbtn, .signupbtn {
    width: 100%;
  }
}

အကြောင်းအရာ:အခြား ဂျပန်ဘာသာ ဂရိုဂျရီစကား ကို အသုံးပြု၍ ပုံမှားအပြင်သို့ လက်ခံကို ပိတ်ပေးသည် ("×" သို့မဟုတ် "cancel" စာကြိုးများ အသုံးပြု၍ ပိတ်ပေးမှု သာမက)

<script>
// ပုံမှားကို ရယူပါ
var modal = document.getElementById('id01');
// အသုံးပြုသူက ပုံမှားမဟုတ်သော နေရာတွင် လက်ခံသည် အား ပိတ်ပေးသည်
window.onclick = function(event) {
    if (event.target == modal) {
        modal.style.display = "none";
    }
}
</script>

亲自试一试

相关页面

教程:HTML 表单

教程:CSS 表单