Jump to content

4.1 Can't centre mobile ads


Day_

Recommended Posts

Not sure why, using the same css as I did in 4.0 but they are stuck to the left, nothing I do will centre them. I'm using

@media screen and (max-width: 767px) {
   #advert_head {min-width: 300px; width: 100%; padding: 0; margin: 0 auto;}
   #advert_foot {min-width: 300px; width: 100%; padding: 5px 0 0 0; margin: 0 auto;}
   #advert_post {min-width: 300px; width: 100%; padding: 0 0 10px 0; margin: 0 auto;}
   #advert_forum {min-width: 300px; width:100%; padding: 0; margin: 0 auto;}
}

Any ideas?

They are centred fine on desktop using

/* LARGER SCREENS */
@media screen and (min-width: 767px) {
   #advert_head {min-width: 728px;  width: 728px; padding: 0 0 15px 0; margin: 0 auto;}
   #advert_foot {min-width: 728px;  width: 728px; padding: 10px 0 0 0; margin: 0 auto;}
   #advert_post {min-width: 728px;  width: 728px; padding: 0 0 15px 0; margin: 0 auto;}
   #advert_forum {min-width: 728px;  width: 728px; padding: 0; margin: 0 auto;}
 }

 

Link to comment
Share on other sites

I've added margin: 0 auto; to the adsense code itself and that seems to have worked, I removed the margin from the css as there was no need to repeat it and on desktop they started aligning to the left. Added back in fine. Not sure what's going off there?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...