.ad-container { display: none; /* or max-height: 0; overflow: hidden; */ } .ad-container.ad-loaded { display: block; /* or any other display property you need */ /* Define the size for when the ad is visible */ min-height: 90px; /* Example size */ }