• Najnowsze pytania
  • Bez odpowiedzi
  • Zadaj pytanie
  • Kategorie
  • Tagi
  • Zdobyte punkty
  • Ekipa ninja
  • IRC
  • FAQ
  • Regulamin
  • Książki warte uwagi

question-closed [CSS] Padding nachodzi na siebie

0 głosów
227 wizyt
pytanie zadane 28 stycznia 2020 w HTML i CSS przez 42savage Bywalec (2,630 p.)
zamknięte 28 stycznia 2020 przez 42savage

Cześć i czołem, tym razem przychodzę z banalnym, niestety nie dla mnie problemem.

Mam problem z paddingiem, który na siebie nachodzi.

Próbowałem to załatwić marginem, ale psuło mi to całkowicie layout.

Jakieś pomysły jak mogę rozwiązać ten problem?

css z komponentu navigation

Zdjęcia wyglądają nie za ciekawie(są skalowane) dlatego podrzucam linka do imgura https://imgur.com/a/HsopHvb

.main_nav_container{
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 11;
    padding: 34px;
}
.items_wrapper{
    list-style: none;
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    background: rgb(7, 88, 88);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10;
}
.fade-enter-active, .fade-leave-active {
  transition: opacity .5s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  opacity: 0;
}
.logo_wrapper{
    z-index: 13;
}
.logo_big{
    text-transform: uppercase;
    color: white;
    font-size: 24px;
}
.logo_small{
    color: white;
    font-size: 12px;
}
.hamburger_button{
    background: none;
    border: none;
    z-index: 13;
    &:focus{
        outline: none;
    }
}
.ham_item{
    width: 40px;
    height: 4px;
    background: white;
    margin: 4px 0;
    transition: 0.1s;
}
.link{
    color: white;
    font-size: 40px;
    text-transform: uppercase;
}
.close_nav:nth-child(1){
    transform: rotate(45deg) translate(5px);
}
.close_nav:nth-child(2){
    transform: rotate(-45deg) translate(5px);
}
@media (min-width:1440px){
   .main_nav_container{
        padding: 56px 100px;
   }
   .logo_big{
       font-size: 36px;
   }
   .logo_small{
       font-size: 18px;
   }
   .logo_big, .logo_small{
       color: black;
   }
    .hamburger_button{
        display: none;
   }
    .items_wrapper{
        display: flex !important;
        position: relative;
        height: auto;
        width: auto;
        flex-direction: row;
        background: none;
        .single_link{
            margin: 0 24px;
            &:last-child{
                margin-right: 0;
            }
        }
        .link{
            color: black;
            font-size: 15px;
        }
    }
}

html z sekcji navigation

  <nav class="main_nav_container">
      <div class="logo_wrapper">
          <h1 class="logo_big">agmar</h1>
          <h3 class="logo_small">meble kuchenne.</h3>
      </div>
      <button class="hamburger_button" @click="showNav = !showNav">
          <div :class="{close_nav: showNav}" class="ham_item"></div>
          <div v-if="!showNav" class="ham_item"></div>
          <div :class="{close_nav: showNav}" class="ham_item"></div>
      </button>
      <transition name="fade">
      <ul class="items_wrapper" v-show="showNav">
          <li class="single_link"><a class="link">Home</a></li>
          <li class="single_link"><a class="link">O firmie</a></li>
          <li class="single_link"><a class="link">Realizacje</a></li>
          <li class="single_link"><a class="link">Oferta</a></li>
          <li class="single_link"><a class="link">Kontakt</a></li>
      </ul>
      </transition>
  </nav>

i css z komponentu slider

.owlOverlay{
  position: relative;
}
.main_carousel_container{
    width: 100%;
    height: 100vh;
}
.slider_item_wrapper{
    width: 100%;
    height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-size: cover !important;
    background-position: center !important;
}
.slider_heading{
  margin: 0 33px 0 34px;
  font-size: 61px;
  font-weight: bold;
  line-height: 81.7%;
  text-shadow: 0px 4px 12px rgba(0, 0, 0, 0.25);
  color: white;
}
.slider_button{
  background: none;
  border: 2px solid white;
  width: 160px;
  height: 40px;
  color: white;
  text-transform: uppercase;
}
.first{
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  height: 60%;
}
.second{
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 40%;
}
.dotsContainer{
  width: 100%;
  position: absolute;
  // display: none;
  bottom: 70px;
  left: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  button{
    width: 12px;
    height: 12px;
    border: none;
    margin: 6px;
    border-radius: 20px;
    &:focus{
      outline: none;
    }
  }
  .active{
    background: white;
  }
}
.navContainer{
  width: 100%;
  display: flex;
  justify-content: space-around;
  flex-direction: row;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 10;
  div{
    width: 50%;
    height: 52px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333333;
  }
}
.owl-prev::before{
  content: '';
  background: url('../assets/phone.png') no-repeat;
  position: absolute;
  left: 15px;
  bottom: 0;
  margin: auto;
  top: 0;
  width: 25px;
  height: 25px;
}
.owl-prev::after{
  content: '';
  background: url('../assets/next.png') no-repeat;
  background-size: 65%;
  background-position: center;
  position: absolute;
  right: 15px;
  bottom: 0;
  margin: auto;
  top: 0;
  width: 25px;
  height: 25px;
}
@media (min-width:1440px){
  .owlOverlay{
    padding: 150px 100px;
    width: 100%;
    height: 100%;
  }
  .main_carousel_container{
    width: 100%;
    height: 100%;
  }
  .owl-carousel, .owl-stage-outer, .owl-stage, .owl-item, .slider_item_wrapper{
    height: 100%;
  }
  .first{
    justify-content: flex-start;
    .slider_heading{
      margin: 0 72px;
      font-size: 42px;
      font-weight: lighter;
    }
  }
  .second{
    justify-content: flex-start;
    align-items: flex-start;
    .slider_button{
          margin: 24px 72px;
    }
  }
  .navContainer{
    position: absolute;
    bottom: 150px;
    left: calc(100% - 200px);
    width: 100px;
    .owl-prev, .owl-next{
      width: 50%;
      color: transparent;
      font-size: 0;
    }
  }
}

oraz html 

<div class="owlOverlay" v-if="images.length > 0">
<carousel class="main_carousel_container" 
  :autoplay="false" 
  :loop="true" 
  :center="true" 
  :items="1" 
  :dotsContainer="'.dotsContainer'" 
  :nav="true"
  @changed="changed"
  :navContainer="'.navContainer'"
  :navText="['KONTAKT', 'OFERTA']"
>
      <div class="slider_item_wrapper" v-for="img in images" :key="img.id" :style="`background-image: ${img.style}, url(${img.url})`">
        <div class="first"><h1 class="slider_heading">{{img.heading_text}}</h1></div>
        <div class="second"><button class="slider_button">{{img.button_text}}</button></div>
    </div>
</carousel>
<div class="dotsContainer"></div>
<div class="navContainer"></div>
</div>

 

komentarz zamknięcia: Dobra, odkryłem, że przez swoje roztrzepanie nie zauważyłem, że nawigacja ma position absolute.

Podobne pytania

0 głosów
1 odpowiedź 247 wizyt
pytanie zadane 30 grudnia 2019 w HTML i CSS przez poldeeek Mądrala (5,980 p.)
0 głosów
2 odpowiedzi 543 wizyt
pytanie zadane 12 lutego 2019 w HTML i CSS przez vingilot85 Obywatel (1,150 p.)
0 głosów
1 odpowiedź 297 wizyt
pytanie zadane 22 sierpnia 2016 w HTML i CSS przez zielonyjoe Nowicjusz (120 p.)

93,720 zapytań

142,641 odpowiedzi

323,265 komentarzy

63,269 pasjonatów

Motyw:

Akcja Pajacyk

Pajacyk od wielu lat dożywia dzieci. Pomóż klikając w zielony brzuszek na stronie. Dziękujemy! ♡

Oto polecana książka warta uwagi.
Pełną listę książek znajdziesz tutaj

Twierdza Linux. Bezpieczeństwo dla dociekliwych

Aby uzyskać rabat -10%, użyjcie kodu pasja-linux, wpisując go w specjalne pole w koszyku.

...