输入不可点击

时间:2018-11-08 09:52:24

标签: html css

我不知道为什么,但是我的输入不可点击。 我看到与类class="cta-inner text-center rounded"有冲突,但我想保留此类的设计。 如果有人有主意

body {
  font-family: 'Lora';
  background: -webkit-gradient(linear, left top, left bottom, from(rgba(47, 23, 15, 0.65))), url("../img/bg.jpg");
  background: linear-gradient(rgba(47, 23, 15, 0.65)), url("../img/bg.jpg");
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Raleway';
}

nav {
  flex-direction: row;
}

p {
  line-height: 1.75;
}

.text-faded {
  color: rgba(255, 255, 255, 0.3);
}

.site-heading {
  margin-top: 5rem;
  margin-bottom: 5rem;
  text-transform: uppercase;
  line-height: 1;
  font-family: 'Raleway';
}

.site-heading .site-heading-upper {
  display: block;
  font-size: 2rem;
  font-weight: 800;
}

.site-heading .site-heading-lower {
  font-size: 5rem;
  font-weight: 100;
  line-height: 4rem;
}

.page-section {
  margin-top: 5rem;
  margin-bottom: 5rem;
}

.section-heading {
  text-transform: uppercase;
}

.section-heading .section-heading-upper {
  display: block;
  font-size: 1rem;
  font-weight: 800;
}

.section-heading .section-heading-lower {
  display: block;
  font-size: 3rem;
  font-weight: 100;
}

.bg-faded {
  background-color: rgba(255, 255, 255, 0.85);
}

#mainNav {
  background-color: rgba(47, 23, 15, 0.9);
  font-family: 'Raleway';
}

#recherche {
  size: 1500px;
}

#valider {
  text-align: right;
}

#mainNav .navbar-brand {
  color: #e6a756;
}

#mainNav .navbar-nav .nav-item .nav-link {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 800;
}

#mainNav .navbar-nav .nav-item.active .nav-link {
  color: #e6a756;
}

@media (min-width: 992px) {
  #mainNav .navbar-nav .nav-item .nav-link {
    font-size: 0.9rem;
  }
  #mainNav .navbar-nav .nav-item .nav-link:hover {
    color: rgba(255, 255, 255, 0.4);
  }
  #mainNav .navbar-nav .nav-item.active .nav-link:hover {
    color: #e6a756;
  }
}

.btn-xl {
  font-weight: 700;
  font-size: 0.8rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  padding-left: 2rem;
  padding-right: 2rem;
}

.intro {
  position: relative;
}

@media (min-width: 992px) {
  .intro .intro-img {
    width: 75%;
    float: right;
  }
  .intro .intro-text {
    left: 0;
    width: 60%;
    margin-top: 3rem;
    position: absolute;
  }
  .intro .intro-text .intro-button {
    width: 100%;
    left: 0;
    position: absolute;
    bottom: -2rem;
  }
}

@media (min-width: 1200px) {
  .intro .intro-text {
    width: 45%;
  }
}

.cta {
  padding-top: 5rem;
  padding-bottom: 5rem;
  background-color: rgba(230, 167, 86, 0.9);
}

.cta .cta-inner {
  position: relative;
  padding: 3rem;
  margin: 0.5rem;
  background-color: rgba(255, 255, 255, 0.85);
}

.cta .cta-inner:before {
  border-radius: 0.5rem;
  content: '';
  position: absolute;
  top: -0.5rem;
  bottom: -0.5rem;
  left: -0.5rem;
  right: -0.5rem;
  border: 0.25rem solid rgba(255, 255, 255, 0.85);
}

@media (min-width: 992px) {
  .about-heading .about-heading-img {
    position: relative;
    z-index: 0;
  }
  .about-heading .about-heading-content {
    margin-top: -5rem;
    position: relative;
    z-index: 1;
  }
}

@media (min-width: 992px) {
  .product-item .product-item-title {
    position: relative;
    z-index: 1;
    margin-bottom: -3rem;
  }
  .product-item .product-item-img {
    position: relative;
    z-index: 0;
    max-width: 60vw;
  }
  .product-item .product-item-description {
    position: relative;
    z-index: 1;
    margin-top: -3rem;
    max-width: 50vw;
  }
}

.list-hours {
  font-size: 0.9rem;
}

.list-hours .list-hours-item {
  border-bottom: 1px solid rgba(230, 167, 86, 0.5);
  padding-bottom: .25rem;
  margin-bottom: 1rem;
  font-style: italic;
}

.list-hours .list-hours-item.today {
  font-weight: bold;
  color: #e6a756;
}

@media (min-width: 992px) {
  .list-hours {
    width: 50%;
    font-size: 1.1rem;
  }
}

.address strong {
  font-size: 1.2rem;
}

.footer {
  background-color: rgba(47, 23, 15, 0.9);
}

.text-primary {
  color: #e6a756 !important;
}

.bg-primary {
  background-color: #e6a756 !important;
}

.btn {
  -webkit-box-shadow: 0px 3px 3px 0px rgba(33, 37, 41, 0.1);
  box-shadow: 0px 3px 3px 0px rgba(33, 37, 41, 0.1);
}

.btn-primary {
  background-color: #e6a756;
  border-color: #e6a756;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #df902a;
  border-color: #df902a;
}

.font-weight-light {
  font-weight: 100 !important;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<section class="page-section cta">
  <div class="row">
    <div class="col-xl-9 mx-auto">
      <div class="cta-inner text-center rounded">
        <h2 class="section-heading mb-5">
          <span class="section-heading-upper">Ajouter un</span>
          <span class="section-heading-lower">Contact</span>
        </h2>
        <form action="envoi.php" method="post" enctype="multipart/form-data" class="list-unstyled list-hours mb-5 text-left mx-auto">
          <div class="list-unstyled-item list-hours-item d-flex">Nom<br>
            <input class="ml-auto" type="text" name="Nom" required><br>
          </div>
          <div class="list-unstyled-item list-hours-item d-flex">Entreprise<br>
            <input class="ml-auto" type="text" name="Entrprise" required><br>
          </div>
          <div class="list-unstyled-item list-hours-item d-flex">Numéro de téléphone<br>
            <input class="ml-auto" name="tel"><br>
          </div>
          <div class="list-unstyled-item list-hours-item d-flex">Commentaire<br>
            <input class="ml-auto" type="text" name="Commentaire"><br>
          </div>
          <div>
            <input id="valider" class="btn btn-default btn-lg active" type="submit" value="Valider">
          </div>
        </form>
      </div>
    </div>
  </div>
</section>

多谢

2 个答案:

答案 0 :(得分:1)

您的CSS在输入的前面引起了一个div。
因此,您的输入不可点击。
这是您错误的css块。

.cta .cta-inner:before {
border-radius: 0.5rem;
content: '';
position: absolute;
top: -0.5rem;
bottom: -0.5rem;
left: -0.5rem;
right: -0.5rem;
border: 0.25rem solid rgba(255, 255, 255, 0.85);
}

只需删除它,因为它没有被使用并且对用户不可见。
那应该修复!
看看我为您制作的jsfiddle:https://jsfiddle.net/9zvoecq4/

答案 1 :(得分:0)

尝试将输入位置设置为相对:

.cta .cta-inner input{
    position: relative;
}

CSS .cta .cta-inner:before与输入重叠,这就是为什么您不能单击它们的原因。随着输入位置的更改,它们可以再次单击。看看这个Fiddle

由于您没有双边框设计,因此从CSS中删除.cta .cta-inner:before会改变样式:

enter image description here