Not sure if I understanf your question.
You can simply add a wrapper to your code.
I am sorry I didn’t make it so clear.
So I want to make a wrapper to an ads block in HTML. The block has a code like this:
<div="code-block code-block-8">
...
</div>
And I want to add another div tag above it so it would be like this:
<div="myAds">
<div="code-block code-block-8">
...
</div>
</div>
Could I do that? And how?
Thanks
If it is only like listed above then set alignment to No wrapping and set the code you would like to use.
However, the Ad Inserter wrapping div contains also classes and attributes for cleint-side functions.
But why would you like an additional wrapping div?
I want to optimize and reduce my site’s Cumulative Layout Shift. The CLS is caused by one adsense unit, that on viewport is. The ads unit is responsive.
When the site is still loading the ads only takes around 50px spaces, but when the site is fully loaded the ads will take up to 250px spaces and pushes the other content below.
So I have to define the ads fixed height to remove the CLS issue. Perhaps you can help me with this issue?
-
This reply was modified 5 years, 3 months ago by
manas12.
You can define ad height using custom CSS and reserve ad space, for example, add this code to the CSS:
https://adinserter.pro/documentation/alignments-and-styles#custom-css
height: 300px;
You can also use block Height setting:
https://adinserter.pro/documentation/additional-block-settings#display
This way the layout will not shift when the block is inserted.