0

Bom dia, gostaria de deixar a classe screwHole com o fundo transparente que desse para ver a cor do body

body{
  background-color: blue;
}    

@font-face {
  font-family: Mandatory;
  src: url(https://andjao.github.io/CapCar/font/mandatory.ttf);
}

.plate {
  background: linear-gradient(135deg, rgba(242, 246, 248, 1) 0%, rgba(216, 225, 231, 1) 33%, rgba(181, 198, 208, 1) 66%, rgba(224, 239, 249, 1) 100%);
  background: rgba(242, 246, 248, 1);
  background: -moz-linear-gradient(-45deg, rgba(242, 246, 248, 1) 0%, rgba(216, 225, 231, 1) 33%, rgba(181, 198, 208, 1) 66%, rgba(224, 239, 249, 1) 100%);
  background: -ms-linear-gradient(-45deg, rgba(242, 246, 248, 1) 0%, rgba(216, 225, 231, 1) 33%, rgba(181, 198, 208, 1) 66%, rgba(224, 239, 249, 1) 100%);
  background: -o-linear-gradient(-45deg, rgba(242, 246, 248, 1) 0%, rgba(216, 225, 231, 1) 33%, rgba(181, 198, 208, 1) 66%, rgba(224, 239, 249, 1) 100%);
  background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(242, 246, 248, 1)), color-stop(33%, rgba(216, 225, 231, 1)), color-stop(66%, rgba(181, 198, 208, 1)), color-stop(100%, rgba(224, 239, 249, 1)));
  background: -webkit-linear-gradient(-45deg, rgba(242, 246, 248, 1) 0%, rgba(216, 225, 231, 1) 33%, rgba(181, 198, 208, 1) 66%, rgba(224, 239, 249, 1) 100%);
  border: .3vw solid #333333;
  border-radius: 3vw;
  box-shadow: .3vw .3vw 1vw #656565;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f2f6f8', endColorstr='#e0eff9', GradientType=1);
  font-family: Mandatory;
  font-size: 3.7vw;
  padding: 2vw 0 2vw 0;
  position: relative;
  text-align: center;
  text-transform: uppercase;
  width: 95vw;
  -webkit-box-shadow: .3vw .3vw 1vw #656565;
}

.screwHolesTop {
  align-items: center;
  display: flex;
  display: -ms-flexbox;
  display: -webkit-box;
  justify-content: space-between;
  position: absolute;
  top: 1vw;
  -ms-flex-align: center;
  -ms-flex-pack: justify;
  -webkit-box-align: center;
  -webkit-box-pack: justify;
}

.screwHole {
  transform: translate(-50%, 0);
  background-color: transparent;
  border-radius: 30%;
  border-style: ridge;
  border-top: 0.2vw solid #656565;
  height: 1.5vw;
  position: absolute;
  width: 5vw;
}

.screwHoleL {
  left: 30vw;
}

.screwHoleR {
  right: -70vw;
}

.screwHolesBottom {
  align-items: center;
  top: 30vw;
  display: flex;
  display: -ms-flexbox;
  display: -webkit-box;
  justify-content: space-between;
  position: absolute;
  -ms-flex-align: center;
  -ms-flex-pack: justify;
  -webkit-box-align: center;
  -webkit-box-pack: justify;
}

.plate1 {
  border: .2vw solid #656565;
  border-radius: 1vw;
  box-shadow: .2vw .2vw 1vw #656565;
  margin: 0 2vw;
  -webkit-box-shadow: .5vw .5vw 1vw #656565;
}

#stateCounty {
  align-items: center;
  background-clip: text;
  border: .15vw solid #656565;
  border-radius: 1vw;
  box-shadow: .5vw .5vw 1vw #656565;
  display: flex;
  display: -ms-flexbox;
  display: -webkit-box;
  justify-content: space-between;
  margin: 3.5vw 6vw -2vw 6vw;
  text-shadow: -.2vw -.2vw 0 #fff, .2vw .2vw 1vw #656565;
  -moz-background-clip: text;
  -ms-flex-align: center;
  -ms-flex-pack: justify;
  -webkit-background-clip: text;
  -webkit-box-align: center;
  -webkit-box-pack: justify;
  -webkit-box-shadow: .5vw .5vw 1vw #656565;
}

.rivet {
  background-color: #000;
  border: .15vw solid #656565;
  border-radius: 100%;
  height: 2vw;
  margin: 0 1.5vw;
  width: 2vw;
  box-shadow: .3vw .3vw 1vw #656565;
}

.rivetL {
  box-shadow: inset 0 0 0 .5vw rgba(242, 246, 248, 1);
  -webkit-box-shadow: inset 0 0 0 .5vw rgba(242, 246, 248, 1);
}

.rivetR {
  box-shadow: inset 0 0 0 .5vw rgba(181, 198, 208, 1);
  -webkit-box-shadow: inset 0 0 0 .5vw rgba(181, 198, 208, 1);
}

#plate {
  background-clip: text;
  border: none;
  font-family: Mandatory;
  font-size: 18vw;
  height: 22vw;
  max-width: 100%;
  position: relative;
  text-align: center;
  text-shadow: -.3vw -.3vw 0 #fff, .5vw .5vw 1vw #656565;
  text-transform: uppercase;
  -moz-background-clip: text;
  -webkit-background-clip: text;
}

#plate::-moz-placeholder {
  font-size: 8vw;
  line-height: 7vw;
  text-shadow: none;
  transform: translate(0, -50%);
}

#plate::-webkit-input-placeholder {
  font-size: 8vw;
  line-height: 7vw;
  text-shadow: none;
  transform: translate(0, -50%);
  -webkit-transform: translate(0, -50%);
}

#plate:-ms-input-placeholder {
  font-size: 8vw;
  line-height: 7vw;
  text-shadow: none;
  transform: translate(0, -50%);
  -ms-transform: translate(0, -50%);
}
<div class="plate">
  <div class="screwHolesTop">
    <div class="screwHole screwHoleL"></div>
    <div class="screwHole screwHoleR"></div>
  </div>
  <div class="plate1">
    <div id="stateCounty">
      <div class="rivet rivetL"></div>
      <div id="stateCountyRes">BRASIL</div>
      <div class="rivet rivetR"></div>
    </div>
    <input type="text" id="plate" placeholder="Digite a placa aqui" value="ABC-1234">
  </div>
  <div class="screwHolesBottom">
    <div class="screwHole screwHoleL"></div>
    <div class="screwHole screwHoleR"></div>
  </div>
</div>

3
  • 2
    Coloca preto, e fala que é a cor do parafuso, não do fundo ;)
    – hugocsl
    Commented 13/05/2020 às 14:52
  • kkkkkkkkkkkkkkk Commented 13/05/2020 às 14:53
  • Uma resposta simples e curta: não tem como. A não ser que vc use a mesma cor de fundo do body no elemento em questão.
    – Sam
    Commented 13/05/2020 às 23:12

2 Respostas 2

3

Essa solução não fica completamente perfeita, mas para mim está aceitável... então vou postar como resposta... Eu coloquei o mesmo background para o body e para o screwHole, coloca algumas configs de background conforme na imagem abaixo

inserir a descrição da imagem aqui

Segue o modelo, vai clicando em "Executar" que cada vez que vc clicar vai carregar uma img diferente pra vc conferir, se não carregar nenhuma imagem carrega a cor.

  
  :root {
    --bgc: red;
    --bgi: url(https://unsplash.it/1000/1000);
  }

  body,
  .screwHole {
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: top left;
    background-attachment: fixed;
    background-color: var(--bgc);
    background-image: var(--bgi);
  }    
  
  @font-face {
    font-family: Mandatory;
    src: url(https://andjao.github.io/CapCar/font/mandatory.ttf);
  }
  
  .plate {
    background: linear-gradient(135deg, rgba(242, 246, 248, 1) 0%, rgba(216, 225, 231, 1) 33%, rgba(181, 198, 208, 1) 66%, rgba(224, 239, 249, 1) 100%);
    background: rgba(242, 246, 248, 1);
    background: -moz-linear-gradient(-45deg, rgba(242, 246, 248, 1) 0%, rgba(216, 225, 231, 1) 33%, rgba(181, 198, 208, 1) 66%, rgba(224, 239, 249, 1) 100%);
    background: -ms-linear-gradient(-45deg, rgba(242, 246, 248, 1) 0%, rgba(216, 225, 231, 1) 33%, rgba(181, 198, 208, 1) 66%, rgba(224, 239, 249, 1) 100%);
    background: -o-linear-gradient(-45deg, rgba(242, 246, 248, 1) 0%, rgba(216, 225, 231, 1) 33%, rgba(181, 198, 208, 1) 66%, rgba(224, 239, 249, 1) 100%);
    background: -webkit-gradient(left top, right bottom, color-stop(0%, rgba(242, 246, 248, 1)), color-stop(33%, rgba(216, 225, 231, 1)), color-stop(66%, rgba(181, 198, 208, 1)), color-stop(100%, rgba(224, 239, 249, 1)));
    background: -webkit-linear-gradient(-45deg, rgba(242, 246, 248, 1) 0%, rgba(216, 225, 231, 1) 33%, rgba(181, 198, 208, 1) 66%, rgba(224, 239, 249, 1) 100%);
    border: .3vw solid #333333;
    border-radius: 3vw;
    box-shadow: .3vw .3vw 1vw #656565;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f2f6f8', endColorstr='#e0eff9', GradientType=1);
    font-family: Mandatory;
    font-size: 3.7vw;
    padding: 2vw 0 2vw 0;
    position: relative;
    text-align: center;
    text-transform: uppercase;
    width: 95vw;
    -webkit-box-shadow: .3vw .3vw 1vw #656565;
  }
  
  .screwHolesTop {
    align-items: center;
    display: flex;
    display: -ms-flexbox;
    display: -webkit-box;
    justify-content: space-between;
    position: absolute;
    top: 1vw;
    -ms-flex-align: center;
    -ms-flex-pack: justify;
    -webkit-box-align: center;
    -webkit-box-pack: justify;
  }
  
  .screwHole {
    transform: translate(-50%, 0);
    /* background-color: transparent; */
    border-radius: 30%;
    border-style: ridge;
    border-top: 0.2vw solid #656565;
    height: 1.5vw;
    position: absolute;
    width: 5vw;
  }
  
  .screwHoleL {
    left: 30vw;
  }
  
  .screwHoleR {
    right: -70vw;
  }
  
  .screwHolesBottom {
    align-items: center;
    top: 30vw;
    display: flex;
    display: -ms-flexbox;
    display: -webkit-box;
    justify-content: space-between;
    position: absolute;
    -ms-flex-align: center;
    -ms-flex-pack: justify;
    -webkit-box-align: center;
    -webkit-box-pack: justify;
  }
  
  .plate1 {
    border: .2vw solid #656565;
    border-radius: 1vw;
    box-shadow: .2vw .2vw 1vw #656565;
    margin: 0 2vw;
    -webkit-box-shadow: .5vw .5vw 1vw #656565;
  }
  
  #stateCounty {
    align-items: center;
    background-clip: text;
    border: .15vw solid #656565;
    border-radius: 1vw;
    box-shadow: .5vw .5vw 1vw #656565;
    display: flex;
    display: -ms-flexbox;
    display: -webkit-box;
    justify-content: space-between;
    margin: 3.5vw 6vw -2vw 6vw;
    text-shadow: -.2vw -.2vw 0 #fff, .2vw .2vw 1vw #656565;
    -moz-background-clip: text;
    -ms-flex-align: center;
    -ms-flex-pack: justify;
    -webkit-background-clip: text;
    -webkit-box-align: center;
    -webkit-box-pack: justify;
    -webkit-box-shadow: .5vw .5vw 1vw #656565;
  }
  
  .rivet {
    background-color: #000;
    border: .15vw solid #656565;
    border-radius: 100%;
    height: 2vw;
    margin: 0 1.5vw;
    width: 2vw;
    box-shadow: .3vw .3vw 1vw #656565;
  }
  
  .rivetL {
    box-shadow: inset 0 0 0 .5vw rgba(242, 246, 248, 1);
    -webkit-box-shadow: inset 0 0 0 .5vw rgba(242, 246, 248, 1);
  }
  
  .rivetR {
    box-shadow: inset 0 0 0 .5vw rgba(181, 198, 208, 1);
    -webkit-box-shadow: inset 0 0 0 .5vw rgba(181, 198, 208, 1);
  }
  
  #plate {
    background-clip: text;
    border: none;
    font-family: Mandatory;
    font-size: 18vw;
    height: 22vw;
    max-width: 100%;
    position: relative;
    text-align: center;
    text-shadow: -.3vw -.3vw 0 #fff, .5vw .5vw 1vw #656565;
    text-transform: uppercase;
    -moz-background-clip: text;
    -webkit-background-clip: text;
  }
  
  #plate::-moz-placeholder {
    font-size: 8vw;
    line-height: 7vw;
    text-shadow: none;
    transform: translate(0, -50%);
  }
  
  #plate::-webkit-input-placeholder {
    font-size: 8vw;
    line-height: 7vw;
    text-shadow: none;
    transform: translate(0, -50%);
    -webkit-transform: translate(0, -50%);
  }
  
  #plate:-ms-input-placeholder {
    font-size: 8vw;
    line-height: 7vw;
    text-shadow: none;
    transform: translate(0, -50%);
    -ms-transform: translate(0, -50%);
  }
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Page Title</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">

</head>
<body>
  
  <div class="plate">
    <div class="screwHolesTop">
      <div class="screwHole screwHoleL"></div>
      <div class="screwHole screwHoleR"></div>
    </div>
    <div class="plate1">
      <div id="stateCounty">
        <div class="rivet rivetL"></div>
        <div id="stateCountyRes">BRASIL</div>
        <div class="rivet rivetR"></div>
      </div>
      <input type="text" id="plate" placeholder="Digite a placa aqui" value="ABC-1234">
    </div>
    <div class="screwHolesBottom">
      <div class="screwHole screwHoleL"></div>
      <div class="screwHole screwHoleR"></div>
    </div>
  </div>
  
<script>

</script>
  
</body>
</html>

2
  • 1
    Foi uma boa, por enquanto vou usar usa ideia enquanto não vejo outra alternativa melhor, vlww mann!!! Commented 13/05/2020 às 15:43
  • @AndersonMarchi tmj!, Se descobrir algo melhor posta ai pra gente :D
    – hugocsl
    Commented 13/05/2020 às 18:18
-1

Você pode conseguir isso definindo a mesma cor de background para o body e para a classe screwHole, assim:

body,
.screwHole {
    background-color: blue;
}

Não vai haver um furo de fato, mas visualmente, será a mesma coisa.

1
  • Vlw pela resposta, mais não isso que eu quero, até pq se o bg do body for uma imagem? Commented 13/05/2020 às 14:12

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 .