The Best Business Forum
The Best Business Forum

How to center the ad in this blog post2899

Member DansCartoons private msg quote post Address this user
See the ad on left side of my blog post? How would I center that in my WordPress editor? Do I wrap it in specific code? Thank you!
Post 1 IP   flag post
vicky4227 private msg quote post Address this user
Ig


If it is an image you want to center, then this image should help you do that. But if it is an ad code, you should click on text button next to visual.
It will bring our the raw code of your post.
When you get to where the ad code is, wrap it with this code:

<center>

ad code right here

</center>

It should send the code to the center of the page.

Hope this helps.
Post 2 IP   flag post
Member DansCartoons private msg quote post Address this user
@vicky4227 Have a look mate....THANK YOU (me: duh?!)
Post 3 IP   flag post
Teacher Rev private msg quote post Address this user
You should not use <center> </center> tags. These have be deprecated for a very long time. Though still supported by some browsers, not all do and most will drop them at some point. CSS is the better choice. If you only need it occasionally and you are not sure how to add full CSS to your theme, use inline CSS in the text editor:

<div style="text-align: center">
<img src="url-to-image-here" />
</div>

An image is treated just like a block of text in this manner.
Post 4 IP   flag post
Member DansCartoons private msg quote post Address this user
I have CSS throughout my site...but I have managed hosting (to avoid intrusion from hackers) and the host that manages approves only speciufic plugins (to avoid further potential hacking....since so many plugins have vulnerabilities)

Sould I replace <center> with code you show here?
Post 5 IP   flag post
Member DansCartoons private msg quote post Address this user
Never heard back from @Rev so looked into this further in the event others may be interested in acquiring CSS code for "centering"..,..what I did was find a CSS technique for ad on this page: https://danscartoons.com/toonblog/cartoonist-blogs/ and did this using:

<div style="text-align:center;">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- 300x250, created 4/25/08 -->
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-8420064843889681"
data-ad-slot="6332040414"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
Post 6 IP   flag post
30467 6 6
Log in or sign up to compose a reply.
destitute