Jump to content

Centering Google AdSense search box


blogsmith
 Share

Recommended Posts

I tried to center a Google AdSense search box atTest Centering Searchboxsurrounding the script with <div style="text-align:center;">script></div>and <span style="text-align:center;">script></spanv>plus even the deprecated <center>script</center>All failed. I remember being able to center the seach box with <center>script</center> before, but now even that don't work.Can anybody help?Thanks

Link to comment
Share on other sites

<div style="text-align:center;">[google script]</div>or<div align="center">[google script]</div>You could add a width too or even this (replace your banner width below accordingly:<div style="margin:0px auto; width:468;">[google script]</div>

Link to comment
Share on other sites

The Cascade of Styling gives id's more 'weight' than classes, so try adding an id= to the element which you need to target. And a class will simply add to the strength of the selector.

<div id="google_ads_id" class="centered" >[google script]</div>div#google_ads_id .centered { margin:0 auto; text-align:center; }

Look here: http://www.w3.org/TR/CSS21/cascade.html#cascadeespecially at 6.4.3 Calculating a selector's specificity

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...