Hello all,
Can somebody help me how i can center the adsense in the midle pages, abouve the categories, top hits, new .......
And yes i read the post about how to, but still dont know in wich place to add that code in the style.css
Thank you
How to center the adsense
Moderator: effi
9 posts • Page 1 of 1
Hello,
Simply, open the template file of the page you want to do that in and then search for {displayAd then place it inside div and set the text-align to center.
For Example:
In the template I use I opened the file templates/balanced/includes/header.tpl
Then I placed {displayAd place="header"} inside a div with the following code:
Ofcourse you are able to manage the div style as you want or as meeting your template specification, but the major thing I think is to set the text-align:center.
Simply, open the template file of the page you want to do that in and then search for {displayAd then place it inside div and set the text-align to center.
For Example:
In the template I use I opened the file templates/balanced/includes/header.tpl
Then I placed {displayAd place="header"} inside a div with the following code:
- Code: Select all
<div style="float:left; text-align:center; width:100%; height:65px">{displayAd place="header"}</div>
Ofcourse you are able to manage the div style as you want or as meeting your template specification, but the major thing I think is to set the text-align:center.
- saidbakr
- Posts: 50
- Joined: Wed Jul 23, 2008 9:09 pm
- Location: Egypt
Well that was my thought, but after trying i just got a blanck space.
So , not working and i dunno why.
For example:
In templates/afroo/includes/news.tpl i used:
What i´m duing wrong ?
Thank you
So , not working and i dunno why.
For example:
In templates/afroo/includes/news.tpl i used:
- Code: Select all
<div class="show_arbo">
<a href="{$setting.siteRootUrl}" class="link_showarbo">{'Directory'|lang}</a> >
<a href="{'/site/news'|url}" class="link_showarbo">{'News'|lang}</a>
</div>
<div style="float:left; text-align:center; width:100%; height:65px">{displayAd place="header"}</div>
<div class="title_h_1">
<h1>{'News'|lang}</h1>
</div>
What i´m duing wrong ?
Thank you
saidbakr wrote:Hello,
Simply, open the template file of the page you want to do that in and then search for {displayAd then place it inside div and set the text-align to center.
For Example:
In the template I use I opened the file templates/balanced/includes/header.tpl
Then I placed {displayAd place="header"} inside a div with the following code:
- Code: Select all
<div style="float:left; text-align:center; width:100%; height:65px">{displayAd place="header"}</div>
Ofcourse you are able to manage the div style as you want or as meeting your template specification, but the major thing I think is to set the text-align:center.
- vippt
- Posts: 4
- Joined: Sun Jun 14, 2009 3:30 pm
OK, i got it
very easy LOL
dont need to use a div just align center.
Thank you for the help.
very easy LOL
dont need to use a div just align center.
- Code: Select all
<p align="center">{displayAd place="overSitesList"} </p>
Thank you for the help.
- vippt
- Posts: 4
- Joined: Sun Jun 14, 2009 3:30 pm
Hello,
The align attribute for HTML elements, currently, regarded as depreciated attribute. Hence, the usage of in-line CSS is more fine to be understood by all modern devices and applications.
By the way, the div styles regarded before, may not suitable or compatible with your template so you may use it as:
<div style="text-align:center; width:100%; height:XXpx;">{displayAd place="overSitesList"}</div>
Where XX is height required for your ad criteria.
The align attribute for HTML elements, currently, regarded as depreciated attribute. Hence, the usage of in-line CSS is more fine to be understood by all modern devices and applications.
By the way, the div styles regarded before, may not suitable or compatible with your template so you may use it as:
<div style="text-align:center; width:100%; height:XXpx;">{displayAd place="overSitesList"}</div>
Where XX is height required for your ad criteria.
- saidbakr
- Posts: 50
- Joined: Wed Jul 23, 2008 9:09 pm
- Location: Egypt
Thank you, much better then my way 
saidbakr wrote:Hello,
The align attribute for HTML elements, currently, regarded as depreciated attribute. Hence, the usage of in-line CSS is more fine to be understood by all modern devices and applications.
By the way, the div styles regarded before, may not suitable or compatible with your template so you may use it as:
<div style="text-align:center; width:100%; height:XXpx;">{displayAd place="overSitesList"}</div>
Where XX is height required for your ad criteria.
- vippt
- Posts: 4
- Joined: Sun Jun 14, 2009 3:30 pm
Never Mind. I hope that you get your directory works fine
and good luck
- saidbakr
- Posts: 50
- Joined: Wed Jul 23, 2008 9:09 pm
- Location: Egypt
9 posts • Page 1 of 1
Return to Templates, plugins and tutorials
Who is online
Users browsing this forum: No registered users and 0 guests

