Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

133
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!