Center HTML in Twenty Eleven theme
-
I am trying to center a line of html code (for a blogads ad) in my Twenty Eleven theme. I have been consulting the forums on this topic over the past 2 days but nothing has worked.
Specifically, I have tried sandwiching the code with <div align=center></div>, and <div style=”text-align: center;”></div>, and I have also tried creating a class in my CSS for centering text, using .alignCenter {margin: 0 auto;} and then sandwiching my code with the new class (again using <div…></div>. Nothing has worked. Most often the ad gets placed behind the foreground frame of my blog and way off to the right.
I have a class in my CSS that seems to be meant for centering things but sandwiching my code with this class (again using div) doesn’t work either. Here’s the CSS code:
.aligncenter {
clear: both;
display: block;
margin-left: auto;
margin-right: auto;
}Totally lost here, any help would be greatly appreciated!!
- The topic ‘Center HTML in Twenty Eleven theme’ is closed to new replies.