PDA

View Full Version : Help? Can't work out this CSS.


starflower
05-19-2008, 09:27 PM
I am creating a website here: www.incomeadvice.co.za

And I'm trying to work out the side-bar code. It's a free website template and when I got it, I got the following code:

<a href="#"><img src="<?php bloginfo('template_url'); ?>/images/thumb1.gif"></img></a>
<a href="#"><img src="<?php bloginfo('template_url'); ?>/images/thumb2.gif"></a>
<a href="#"><img src="<?php bloginfo('template_url'); ?>/images/thumb3.gif"></img></a>

Instead of wanting three 100 by 100 images all by side-by-side. I wanted two 125 by 125 ads next to each other in three lines. Therefore three lines of two 125 by 125 ads.

I tried to put in two originally but one of my ad's wont show up. My code is now the following:

<div align="left"><a href="#" target="_blank"><img src="<?php bloginfo('template_url'); ?>/images/TrafficSynergy.gif" border="0" align="absmiddle"></a></img>
<a href="#" target="_blank"><img src="<?php bloginfo('template_url'); ?>/images/hostgator.gif" border="0" align="absmiddle"></a></img></div>

Can anyone help me with why this isn't working? And maybe help me along with the code to have two ad's each in three lines?? Thanks a million! If you need more information just let me know :)

m1a2x3x7
05-19-2008, 10:00 PM
in the code given there's no css to work out.

You can try doing this height = "125px" width = "125px"

<div align="left"><a href="#" target="_blank"><img src="<?php bloginfo('template_url'); ?>/images/TrafficSynergy.gif" border="0" align="absmiddle" height="125px" width="125px"></a></img>
<a href="#" target="_blank"><img src="<?php bloginfo('template_url'); ?>/images/hostgator.gif" border="0" align="absmiddle" height="125px" width="125px"></a></img></div>If that doesn't work then their php code must be setting it to the 100 x 100.

Cary
05-20-2008, 02:28 AM
You're on the right track. You just need to get the php to create valid html. I used the html below for testing purposes. I'm not sure how the php should be changed.

<div class="advertise">
<div align="left">
<a href="http://secure.hostgator.com/" target="_blank"><img src="wp-content/themes/WP_Premium/images/hostgator.gif" alt="" /></a>
<a href="http://secure.hostgator.com/" target="_blank"><img src="wp-content/themes/WP_Premium/images/hostgator.gif" alt="" /></a>
<a href="http://secure.hostgator.com/" target="_blank"><img src="wp-content/themes/WP_Premium/images/hostgator.gif" alt="" /></a>
<a href="http://secure.hostgator.com/" target="_blank"><img src="wp-content/themes/WP_Premium/images/hostgator.gif" alt="" /></a>
<a href="http://secure.hostgator.com/" target="_blank"><img src="wp-content/themes/WP_Premium/images/hostgator.gif" alt="" /></a>
<a href="http://secure.hostgator.com/" target="_blank"><img src="wp-content/themes/WP_Premium/images/hostgator.gif" alt="" /></a>
</div>
</div>


The only change I made to your CSS is this:

#sidebar .advertise img {
padding:0 0 10px 30px;
border:none;
}

Cary
05-20-2008, 02:41 AM
Or maybe something like this:

<a href="#" target="_blank"><img src="<?php bloginfo('template_url'); ?>/images/TrafficSynergy.gif" height="125px" width="125px" alt="" /></a>
<a href="#" target="_blank"><img src="<?php bloginfo('template_url'); ?>/images/hostgator.gif" height="125px" width="125px" alt="" /></a>

The code you were using has nesting problems with the tags (and the TrafficSynergy.gif isn't present). You have something like this:

<a ...><img ....></a></img>

when you should have

<a ...><img ... /></a>

starflower
05-20-2008, 11:53 AM
Oh why word, it works! Thank you very much Cary :) I knew one of the wonderful people at Dreamweaver could help me - you always do! Thanks again!!!!