Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

136
Vistas
Should I use a parent div for AdSense Ad units?

The big article container div has a width of 2358px. I'm doing proportional scaling to make it fit in mobile devices. My concern is, if I put the ad unit code within a parent div that has smaller width like 500px, is it gonna be fine? Like without a parent div it's a bit uncertain how google will calculate ads size as the total width is too big for mobile device. Probably the ads will not display. But will setting a parent div outside with smaller width fix this problem? Does responsive google ad depend on parent div or the bigger main article div?

CSS

#Web_1920__1 
{
    position: absolute;
    background-color: rgba(0,0,0,0);
    width: 2358px;
    height: 5216px;
    overflow: visible;
}
.ads-style-one-phone
{
    position: relative;
    left: 835px;
    width: 500px;
    height: auto;
    border: 4px rgba(255,255,255,0.3) solid;
    border-radius: 5px;
    margin-bottom: 500px;
    margin-top: 640px;
} 

HTML

<div id="Web_1920__1">
<div class="ads-style-one-phone">
                 <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-xxxxxxxxxx"
                 crossorigin="anonymous"></script>
                 <!-- Display vertical -->
                 <ins class="adsbygoogle"
                      style="display:block"
                      data-ad-client="ca-pub-xxxxxxxxxx"
                      data-ad-slot="xxxxxxxxx"
                      data-ad-format="auto"
                      data-full-width-responsive="true">
                 </ins>
                 <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> 
</div>
</div>

If I put the ad unit code inside a parent div, is there any problem as the main big div has a width of 2358px..?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda