Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

164
Visualizações
is there any way to achieve full parent width inside a div even if the parent has padding?

i have a card element here inside this card as you can see i have 2headings and one apex chart. currently the chart also look smaller because of the padding i set on the parent div. i want to make this chart look like a background image ( but i can't set it as background because it's not an SVG ). and see the second image to understand what i want to achieve!

currently what i have

i want the output like this! currently i achieve this by making the chart in a absolute position and tweaking the bottom and left properties little by little, is there any cleaner way to implement this?

what i need to achieve

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Suppose the parent element has padding: 20px. On the child element you can do:

.child{
  width: calc(100% + 20px * 2);
  transform: translateX(calc(-1 * 20px));
}
about 4 years ago · Juan Pablo Isaza Relatório

0

You can use negative margin to offset the padding

.parent {
  background: yellow;
  padding: 20px;
  width: 150px;
  height: 150px;
  margin: auto
}

.child {
  background: green;
  margin: 0 -20px;
  height: 100%
}
<div class="parent">
  <div class="child"></div>
</div>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda