Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

[SOLVED] Center ad in Header in 3.4.4


  #1  
Old Jan 27, 2010, 10:06 AM
ShootWireless
 
3 posts · Jan 2010
I swear I have searched and tried everything I could find, but it isn't working for me for some reason.

I have added a new widget area in my header section.
<?php bfa_widget_area('name=swheaderfullbanner&cells=1') ; ?>

I have added my ad code into the widget and it shows up in the header. Now I just want to center the ad image that shows up. I tried adding CSS in "add html/css inserts", but I'm not sure if I have the correct CSS. I've tried what has been posted already.

Here are some of the variations of the CSS I have tried. Let me know if you know one of them should work. When I look at my source code I see that the "swheaderfullbanner" is a div. I'm still a little unclear on when to use '#' and when to use '.' in my CSS.

div#swheaderfullbanner{margin-right: auto;margin-left: auto;}
div.swheaderfullbanner{margin-right: auto;margin-left: auto;}

Did something change with 3.4.4 (or an earlier version) that would make this not work?

I originally had my theme doing a fluid width (99%, 600 min, 900 max), and have recently tried doing fixed width (900, 600 min) after reading another post and have no change in behavior.

Thanks,

Scott
  #2  
Old Jan 27, 2010, 10:39 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
What is the URL?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Jan 27, 2010, 10:59 AM
ShootWireless
 
3 posts · Jan 2010
http://www.shootwireless.com/
  #4  
Old Jan 28, 2010, 05:51 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Try adding this to ATO->Add HTML/CSS Inserts->CSS Inserts
HTML Code:
#swheaderfullbanner  {
margin-left:auto;
margin-right:auto;
width:40%;
}
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Jan 28, 2010, 10:18 AM
ShootWireless
 
3 posts · Jan 2010
Thanks for the tip. The code you provided worked OK for the small ad image I was using. When I changed it to 50% from 40% for the width the small image was centered and stayed centered when I resized the browser window. I am back to using a Fluid layout width.

Then as a test I changed to a larger ad image and the image was no longer centered. Then I realized what was going on. I wanted the contents of the swheaderfullbanner DIV to be centered, not the DIV container itself.

So, I ended up using this for my added CSS:
#swheaderfullbanner{text-align:center;}

That centers my large and small banner ad images inside the DIV container, which stays at 100% of the width of the layout, even when resizing the browser window.

Do you see any issues using that text-align style to keep my image centered within the custom widget area?
  #6  
Old Jan 28, 2010, 01:25 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Nope, I don't see any problem. Glad it's working for you. - turnd out that when you only have one cell in a new widget area, this is how you center it because it is a DIV. If you have more than one cell, you get a TABLE and then you can use the 'align' property of the new widget statement.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Jan 28, 2010 at 01:27 PM.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to center the logo? joe hark Header configuration & styling 8 Sep 11, 2010 12:33 PM
How can I get my logo in the center of the header area? vasantib Header configuration & styling 22 Mar 12, 2010 08:49 AM
IE ruins aligned images in header & center column, & doesn't size nav menu buttons viewdesigninc Header configuration & styling 0 Dec 11, 2009 01:07 PM
[SOLVED] Center Header Widget? ChrisPanimation Header configuration & styling 14 Nov 30, 2009 08:48 PM
Center Column chiaxiong Atahualpa 3 Wordpress theme 1 Apr 8, 2009 06:28 PM


All times are GMT -6. The time now is 08:10 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.