Today’s question comes for Audrey of Audrey Salutes, “how do I center my third-party media ads in my widget?”
Third-party media ads are ads you would use from Rewardstyle, Glam or Blogher. Most bloggers express a lot of frustration when trying to set them up. Ads. Often, everything in the sidebar will be centered besides it.
Most bloggers try to use this method to center their ad:
While it is accurate, it is not the best practice. Your ad is interactive and functioning feature. It needs to be placed in a <div>. This option works most of the time:
<div style="text-align: center;">
Occasionally, ads can be extremely strange and center some of the time. One way to prevent is this is to assign a "display:block" to your <div>. Thus, you would have:
<div style="display: block; text-align: center;">
What is “display: block”? Without getting too complicated, assigning a block level display to an element (your ad) means that the browser will display line breaks before and after the
will take up the full-width of the available space, and the elements in it with be now centered. If you want to align your elements left or right, simply replace “center” with either/or.
Do you have tech or design questions you would like answered? "Techie Tuesdays" is a weekly series written by Lindsay Humes of White Oak Creative. In order to make this series as beneficial to Midwest Bloggers, you can email your specific questions to Lindsay at email@example.com, and she will answer them in her weekly series.