css 联系表格不会让我在里面键入

kkih6yb8  于 2023-01-18  发布在  其他
关注(0)|答案(1)|浏览(152)

我试图创建一个联系人的形式为我的网上商店,我遇到了一个错误,当我试图在我的文本字段内键入网站不允许我这样做。
我试过几种方法,但都没有多大帮助。我还没有添加任何JavaScript,但我不确定这是我问题的根源还是简单的东西。

* {
  margin: 0;
  padding: 0;
  font-family: 'poppins', sans-serif;
  box-sizing: border-box;
}

.hero {
  background: #1d2026;
  min-height: 100vh;
  width: 100%;
  color: #fff;
  position: relative;
}

nav {
  display: flex;
  align-items: center;
}

nav .menu {
  width: 50px;
  margin-right: 20px;
  cursor: pointer;
  padding-bottom: 50px;
}

nav .logo {
  width: 500px;
  height: 200px;
  object-fit: none;
  padding-right: 80px;
  padding-bottom: 55px;
}

nav ul {
  flex: 1;
  text-align: right;
  margin-right: 20px
}

nav ul li {
  display: inline-block;
  list-style: none;
  margin-right: 20px;
  padding-bottom: 100px;
  font-size: 25px;
  margin: 0 20px;
}

nav ul a {
  text-decoration: none;
  color: #fff;
}

.lamp-set {
  position: absolute;
  top: -20px;
  left: 22%;
  width: 200px;
}

.lamp {
  width: 100%;
}

.light {
  position: absolute;
  top: 97%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  margin-left: -10px;
  opacity: 1;
}

.text-container {
  max-width: 1000px;
  margin-top: 2%;
  margin-left: 50%;
}

.text-container h1 {
  font-size: 80px;
  font-weight: 400;
  display: inline-block;
  color: #fff;
}

.text-container p {
  font-size: 40px;
  font-weight: 200;
  display: inline-block;
  color: #fff;
  margin-top: 10px;
}

.emails {
  background: #00a8f3;
  padding: 14px 40px;
  display: inline-block;
  color: #fff;
  font-size: 25px;
  margin-top: 30px;
  margin-left: 50%;
  border-radius: 30px;
}

.villian {
  background: #1d2026;
  min-height: 100vh;
  width: 100%;
  color: #fff;
  position: relative;
}

.text-contact {
  max-width: 1000px;
  margin-top: 2%;
  margin-left: 50%;
}

.text-contact h1 {
  font-size: 50px;
  font-weight: 400;
  display: inline-block;
  color: #fff;
}

.text-shop h1 {
  font-size: 80px;
  font-weight: 400;
  display: inline-block;
  color: #fff;
  margin-left: 50%;
}

.text-contact p {
  font-size: 40px;
  font-weight: 200;
  display: inline-block;
  color: #fff;
  margin-top: 10px;
}

.container {
  display: flex;
  align-items: center;
  justify-content: center;
}

form {
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 2vw 4vw;
  width: 90%;
  max-width: 600px;
  border-radius: 10px;
}

form h3 {
  color: #555;
  font-weight: 800;
  margin-bottom: 20px;
  text-decoration: none;
}

form input,
form textarea {
  border: 0;
  margin: 10px 0;
  padding: 20px;
  outline: none;
  background: #f5f5f5;
  font-size: 16px;
}

form button {
  padding: 15px;
  background: #00a8f3;
  color: #fff;
  font-size: 18px;
  border: 0;
  outline: none;
  cursor: pointer;
}

a:link {
  text-decoration: none;
}

a:visited {
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

a:active {
  text-decoration: none;
}
<div class="hero">
  <nav>
    <img src="menu.png" class="menu">
    <img src="ovlogo.png" class="logo">
    <ul>
      <li><a href="index.html">Home</li>
                <li><a href="contact.html">contact</li> 
            </ul>   
        </nav>
            <div class="container">
                <form>
                    <h3>Get in touch</h3>
                    <input type="text" id="name" placeholder="Your name" required>
                    <input type="email" id="email" placeholder="Email" required>
                    <input type="text" id="phone" placeholder="Phone number" required>
                    <textarea id="message" rows="4" placeholder="How can we assist you?"></textarea>
                    <button type="submit">Submit</button>
                </form>
    </div>
    </div>
9lowa7mx

9lowa7mx1#

你忘了关闭你的a标签,所以整个页面是一个链接,这意味着如果你点击任何包含在该链接(几乎所有低于标签),它会重新加载页面修复是添加</a>关闭它。
1.触点

* {
  margin: 0;
  padding: 0;
  font-family: 'poppins', sans-serif;
  box-sizing: border-box;
}

.hero {
  background: #1d2026;
  min-height: 100vh;
  width: 100%;
  color: #fff;
  position: relative;
}

nav {
  display: flex;
  align-items: center;
}

nav .menu {
  width: 50px;
  margin-right: 20px;
  cursor: pointer;
  padding-bottom: 50px;
}

nav .logo {
  width: 500px;
  height: 200px;
  object-fit: none;
  padding-right: 80px;
  padding-bottom: 55px;
}

nav ul {
  flex: 1;
  text-align: right;
  margin-right: 20px
}

nav ul li {
  display: inline-block;
  list-style: none;
  margin-right: 20px;
  padding-bottom: 100px;
  font-size: 25px;
  margin: 0 20px;
}

nav ul a {
  text-decoration: none;
  color: #fff;
}

.lamp-set {
  position: absolute;
  top: -20px;
  left: 22%;
  width: 200px;
}

.lamp {
  width: 100%;
}

.light {
  position: absolute;
  top: 97%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  margin-left: -10px;
  opacity: 1;
}

.text-container {
  max-width: 1000px;
  margin-top: 2%;
  margin-left: 50%;
}

.text-container h1 {
  font-size: 80px;
  font-weight: 400;
  display: inline-block;
  color: #fff;
}

.text-container p {
  font-size: 40px;
  font-weight: 200;
  display: inline-block;
  color: #fff;
  margin-top: 10px;
}

.emails {
  background: #00a8f3;
  padding: 14px 40px;
  display: inline-block;
  color: #fff;
  font-size: 25px;
  margin-top: 30px;
  margin-left: 50%;
  border-radius: 30px;
}

.villian {
  background: #1d2026;
  min-height: 100vh;
  width: 100%;
  color: #fff;
  position: relative;
}

.text-contact {
  max-width: 1000px;
  margin-top: 2%;
  margin-left: 50%;
}

.text-contact h1 {
  font-size: 50px;
  font-weight: 400;
  display: inline-block;
  color: #fff;
}

.text-shop h1 {
  font-size: 80px;
  font-weight: 400;
  display: inline-block;
  color: #fff;
  margin-left: 50%;
}

.text-contact p {
  font-size: 40px;
  font-weight: 200;
  display: inline-block;
  color: #fff;
  margin-top: 10px;
}

.container {
  display: flex;
  align-items: center;
  justify-content: center;
}

form {
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 2vw 4vw;
  width: 90%;
  max-width: 600px;
  border-radius: 10px;
}

form h3 {
  color: #555;
  font-weight: 800;
  margin-bottom: 20px;
  text-decoration: none;
}

form input,
form textarea {
  border: 0;
  margin: 10px 0;
  padding: 20px;
  outline: none;
  background: #f5f5f5;
  font-size: 16px;
}

form button {
  padding: 15px;
  background: #00a8f3;
  color: #fff;
  font-size: 18px;
  border: 0;
  outline: none;
  cursor: pointer;
}

a:link {
  text-decoration: none;
}

a:visited {
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

a:active {
  text-decoration: none;
}
<div class="hero">
  <nav>
    <img src="menu.png" class="menu">
    <img src="ovlogo.png" class="logo">
    <ul>
      <li><a href="index.html">Home</li>
                <li><a href="contact.html">contact</a></li> 
            </ul>   
        </nav>
            <div class="container">
                <form>
                    <h3>Get in touch</h3>
                    <input type="text" id="name" placeholder="Your name" required>
                    <input type="email" id="email" placeholder="Email" required>
                    <input type="text" id="phone" placeholder="Phone number" required>
                    <textarea id="message" rows="4" placeholder="How can we assist you?"></textarea>
                    <button type="submit">Submit</button>
                </form>
    </div>
    </div>

相关问题