-1

While doing a site with html and css I've faced problem with transparent box. Every element in this box is transparent too, but I want it without opacity. How can I fix this?

.parent {
  display: inline-block;
  position:relative;
  width: 100%;
  border: 2px solid rgb(255, 255, 255);
}

.transbox {
  height: 350px;
  width: 100%;
  background-color: #ffffff;
  opacity: 0.4;
  display: flex;
  justify-content: center;
}

.parent .transbox .search-form {
  display: flex;
  justify-content: center;
  align-items: center;
}
  <!-- Search form -->
  <div class="container py-6 py-lg-7 text-white overlay-content text-center">
    <div class="parent">
      <div class="transbox">
        <div class="search-form" id="id_forms">
            <div class="col-lg-4">
                {{ search_form.category }}
            </div>
            <div class="col-lg-4">
                {{ search_form.city }}
            </div>
            <button class="btn btn-primary custom-btn" type="submit"><i class="fas fa-search"></i>Szukaj</button>
        </div>
      </div>
    </div>
  </div>
Dulani Maheshi
  • 1,070
  • 1
  • 10
  • 30

1 Answers1

0

try to use rgba(255,255,255,0.4) in the background-color attribute