Kashiya ta a fariya cin kiwon:

Tattara kashiya ta a fariya cin kiwon

Fariya cin kiwon

A fariya cin kiwon na yana a yin gaba (indakada a fariya cin kiwon da taga na yiwa kudu-kudu, kuma kuma yana a haliwarin kiwon)

Girmirin kai

Kashiya ta a fariya cin kiwon

第一步 - Tattara HTML:

A gina <form> a haliwarin cin kiwon. Anu ka iya a na dake haliwarin nkan na dake. PHP Yarminin 中了解更多信息。

为每个字段添加输入控件(并带有匹配的标签):

<form action="/action_page.php">
  <label for="fname">First Name</label>
  <input type="text" id="fname" name="firstname" placeholder="Your name..">
  <label for="lname">Last Name</label>
  <input type="text" id="lname" name="lastname" placeholder="Your last name..">
  <label for="country">Country</label>
  <select id="country" name="country">
    <option value="australia">Australia</option>
    <option value="canada">Canada</option>
    <option value="usa">USA</option>
  </select>
  <input type="submit" value="Submit">
</form>

第二步 - 添加 CSS:

/* 设置输入字段的样式 */
  input[type=text], select {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}
/* 设置提交按钮的样式 */
input[type=submit] {
  width: 100%;
  background-color: #04AA6D;
  color: white;
  padding: 14px 20px;
  margin: 8px 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
/* 为鼠标悬停时的提交按钮添加背景颜色 */
input[type=submit]:hover {
  background-color: #45a049;
}

Girmirin kai

Wurare da yana ƙara

Yarminin:HTML Fumari

Yarminin:CSS Fumari