0

preciso de uma grande ajuda, criei um layout conforme no exemplo abaixo

<style>
/*
 CSS for the main interaction
*/
.tabset > input[type="radio"] {
  position: absolute;
  left: -200vw;
}

.tabset .tab-panel {
  display: none;
}

.tabset > input:first-child:checked ~ .tab-panels > .tab-panel:first-child,
.tabset > input:nth-child(3):checked ~ .tab-panels > .tab-panel:nth-child(2),
.tabset > input:nth-child(5):checked ~ .tab-panels > .tab-panel:nth-child(3),
.tabset > input:nth-child(7):checked ~ .tab-panels > .tab-panel:nth-child(4),
.tabset > input:nth-child(9):checked ~ .tab-panels > .tab-panel:nth-child(5),
.tabset > input:nth-child(11):checked ~ .tab-panels > .tab-panel:nth-child(6) {
  display: block;
}

/*
 Styling
*/
body {
  font: 16px/1.5em "Overpass", "Open Sans", Helvetica, sans-serif;
  color: #333;
  font-weight: 300;
}

.tabset > label {
  position: relative;
  display: inline-block;
  padding: 15px 15px 25px;
  border: 1px solid transparent;
  border-bottom: 0;
  cursor: pointer;
  font-weight: 600;
}



.tabset > label:hover,
.tabset > input:focus + label {
  color: #06c;
}

.tabset > label:hover::after,
.tabset > input:focus + label::after,
.tabset > input:checked + label::after {
  background: #06c;
}

.tabset > input:checked + label {
  border-color: #ccc;
  border-bottom: 1px solid #fff;
  margin-bottom: -1px;
}

.tab-panel {
  padding: 30px 0;
  border-top: 1px solid #ccc;
}

/*
 Demo purposes only
*/
*,
*:before,
*:after {
  box-sizing: border-box;
}

body {
  padding: 30px;
}

.tabset {
  max-width: 65em;
}

.tabset {
    max-width: 65em;
    border: 1px solid gra;
    border-radius: 10px;
    border-left: 1px solid gray;
    border-right: 1px solid gray;
    border-bottom: 1px solid gray;
        
}

.tabset > input:checked + label {
    border-color: #ccc;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;

}
</style>
<center>
<div class="tabset">
  <!-- Tab 1 -->
  <input type="radio" name="tabset" id="tab1" aria-controls="marzen" checked>
  <label for="tab1">Box 1</label>
  <!-- Tab 2 -->
  <input type="radio" name="tabset" id="tab2" aria-controls="rauchbier">
  <label for="tab2">Box 2</label>
  <!-- Tab 3 -->
  <input type="radio" name="tabset" id="tab3" aria-controls="dunkles">
  <label for="tab3">Box 3</label>
  
  <div class="tab-panels">
    <section id="marzen" class="tab-panel">
      <h2>texto 1</h2>
    <label>
    <span> teste</span>
    <input type="tel" name="telephone">
  </label>
   <select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="fiat">Fiat</option>
  <option value="audi">Audi</option>
   </select> 

    <select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="fiat">Fiat</option>
  <option value="audi">Audi</option>
   </select> 

 <a> botão </a>


  </section>
    <section id="rauchbier" class="tab-panel">
    <h2>texto 2</h2>
    <label>
    <span> teste</span>
    <input type="tel" name="telephone">
  </label>
   <select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="fiat">Fiat</option>
  <option value="audi">Audi</option>
   </select> 

    <select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="fiat">Fiat</option>
  <option value="audi">Audi</option>
   </select> 

 <a> botão </a>

    </section>



    <section id="dunkles" class="tab-panel">
      <h2>texto 3 </h2>
    <label>
    <span> teste</span>
    <input type="tel" name="telephone">
  </label>
   <select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="fiat">Fiat</option>
  <option value="audi">Audi</option>
   </select> 

    <select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="fiat">Fiat</option>
  <option value="audi">Audi</option>
   </select> 

 <a> botão </a>
    </section>
  </div>
  
</div>
</center>

Eu preciso remover as bordas da direita e esquerda conforme o print abaixo.

inserir a descrição da imagem aqui

Como eu posso fazer isso via css?

2 Respostas 2

1

Basta não usar a boda no elemento pai e sim no elemento filho que é o container das tabs. Então remova as bordas do .tabset e coloque no .tab-panels

inserir a descrição da imagem aqui

Seu CSS vai ficar assim, repare que no border-radius eu só usei a curvatura nos dois cantos inferiores e no topo deixei reto, para isso usei 4 valores 0 0 10px 10px

.tab-panels {
  border: 1px solid gray;
  border-radius: 0 0 10px 10px ;
  border-top: none;
}

Isso corresponderia a

border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;

Leia mais aqui: https://developer.mozilla.org/pt-BR/docs/Web/CSS/border-radius

/*
  CSS for the main interaction
*/
.tabset > input[type="radio"] {
  position: absolute;
  left: -200vw;
}

.tabset .tab-panel {
  display: none;
}

.tabset > input:first-child:checked ~ .tab-panels > .tab-panel:first-child,
.tabset > input:nth-child(3):checked ~ .tab-panels > .tab-panel:nth-child(2),
.tabset > input:nth-child(5):checked ~ .tab-panels > .tab-panel:nth-child(3),
.tabset > input:nth-child(7):checked ~ .tab-panels > .tab-panel:nth-child(4),
.tabset > input:nth-child(9):checked ~ .tab-panels > .tab-panel:nth-child(5),
.tabset > input:nth-child(11):checked ~ .tab-panels > .tab-panel:nth-child(6) {
  display: block;
}

.tab-panels {
  border: 1px solid gray;
  border-radius: 0 0 10px 10px ;
  border-top: none;
}
/*
  Styling
*/
body {
  font: 16px/1.5em "Overpass", "Open Sans", Helvetica, sans-serif;
  color: #333;
  font-weight: 300;
}

.tabset > label {
  position: relative;
  display: inline-block;
  padding: 15px 15px 25px;
  border: 1px solid transparent;
  border-bottom: 0;
  cursor: pointer;
  font-weight: 600;
}



.tabset > label:hover,
.tabset > input:focus + label {
  color: #06c;
}

.tabset > label:hover::after,
.tabset > input:focus + label::after,
.tabset > input:checked + label::after {
  background: #06c;
}

.tabset > input:checked + label {
  border-color: #ccc;
  border-bottom: 1px solid #fff;
  margin-bottom: -1px;
}

.tab-panel {
  padding: 30px 0;
  border-top: 1px solid #ccc;
}

/*
  Demo purposes only
*/
*,
*:before,
*:after {
  box-sizing: border-box;
}

body {
  padding: 30px;
}

.tabset {
  max-width: 65em;
}

.tabset {
    max-width: 65em;
        
}

.tabset > input:checked + label {
    border-color: #ccc;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;

}
<center>
<div class="tabset">
  <!-- Tab 1 -->
  <input type="radio" name="tabset" id="tab1" aria-controls="marzen" checked>
  <label for="tab1">Box 1</label>
  <!-- Tab 2 -->
  <input type="radio" name="tabset" id="tab2" aria-controls="rauchbier">
  <label for="tab2">Box 2</label>
  <!-- Tab 3 -->
  <input type="radio" name="tabset" id="tab3" aria-controls="dunkles">
  <label for="tab3">Box 3</label>
  
  <div class="tab-panels">
    <section id="marzen" class="tab-panel">
      <h2>texto 1</h2>
    <label>
    <span> teste</span>
    <input type="tel" name="telephone">
  </label>
    <select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="fiat">Fiat</option>
  <option value="audi">Audi</option>
    </select> 

    <select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="fiat">Fiat</option>
  <option value="audi">Audi</option>
    </select> 

  <a> botão </a>


  </section>
    <section id="rauchbier" class="tab-panel">
    <h2>texto 2</h2>
    <label>
    <span> teste</span>
    <input type="tel" name="telephone">
  </label>
    <select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="fiat">Fiat</option>
  <option value="audi">Audi</option>
    </select> 

    <select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="fiat">Fiat</option>
  <option value="audi">Audi</option>
    </select> 

  <a> botão </a>

    </section>



    <section id="dunkles" class="tab-panel">
      <h2>texto 3 </h2>
    <label>
    <span> teste</span>
    <input type="tel" name="telephone">
  </label>
    <select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="fiat">Fiat</option>
  <option value="audi">Audi</option>
    </select> 

    <select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="fiat">Fiat</option>
  <option value="audi">Audi</option>
    </select> 

  <a> botão </a>
    </section>
  </div>
  
</div>
</center>

2
  • 1
    Valeu cara! Me ajudou muito, abs. Commented 29/04/2019 às 15:40
  • 1
    @ThiagoMaia tranquilo jovem, não deixe de dar uma olhada no link com a documentação
    – hugocsl
    Commented 29/04/2019 às 15:42
-1

Mude o border-right e o border-left para none.

1
  • Eu fiz isso mas ele apaga as bordas da esquerda e direita totalmente, eu preciso que sejam apagadas somente as bordas superiores, que estão sobrando, como no print. Commented 29/04/2019 às 15:24

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .