Aligning this banner?

Discussion in 'HTML & Website Design' started by dpatel304, Jul 1, 2007.

  1. #1
    my page:
    http://www.afkay.com/forums/forumdisplay.php?f=40

    [​IMG]

    I basically want to move the ad up just a tad so it is more aligned with the background.

    This is the code for it:
    <a name="top"></a>
    <table width="98%" height="171" border="0" cellpadding="0" cellspacing="0" align="center" style="background: url($stylevar[imgdir_misc]/header_3.jpg) repeat-x top;">
      <tr>
          <td width="416" height="171" rowspan="2" align="center" style="background: url($stylevar[imgdir_misc]/header_1.jpg) no-repeat left;">
        <img src="$stylevar[imgdir_misc]/spacer.gif" alt="" width="416" height="1">
        
        <div style="height: 30px;"></div>
        </td>
        <td rowspan="2" width="28" style="background: url($stylevar[imgdir_misc]/header_2.jpg) no-repeat;"><img src="$stylevar[imgdir_misc]/spacer.gif" alt="" width="28" height="1"></td>
        <td height="133" align="center">
          <!-- PLACE YOUR AD OR OTHER CODE HERE -->
    $banner
    
          <!-- /PLACE YOUR AD OR OTHER CODE HERE -->
        </td>
         <td rowspan="2" width="37"><img src="$stylevar[imgdir_misc]/header_4.jpg" alt="" width="37" height="171"></td>
      </tr>
        <tr>
        <td align="center" height="38" style="background: url($stylevar[imgdir_misc]/header_5.jpg) repeat-x top; font-weight: bold;">
    Code (markup):
    I am using a rotating banner mod, if that makes a difference:
    http://www.vbulletin.org/forum/showthread.php?t=106682&highlight=rotating+banner
     
    dpatel304, Jul 1, 2007 IP
  2. PDoc

    PDoc Peon

    Messages:
    47
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try adding valign="top" in the td tag:

    
    <td height="133" align="center" valign="top">
          <!-- PLACE YOUR AD OR OTHER CODE HERE -->
    $banner
    
          <!-- /PLACE YOUR AD OR OTHER CODE HERE -->
    </td>
    
    HTML:
    I think that should fix it.
     
    PDoc, Jul 1, 2007 IP
  3. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #3
    IMO is best with CSS, but also you can use "style":
    
    <td style="height:133px; text-align:center; vertical-align:top;"
      <!-- PLACE YOUR AD OR OTHER CODE HERE -->
      $banner
      <!-- /PLACE YOUR AD OR OTHER CODE HERE -->
    </td>
    
    HTML:
     
    ajsa52, Jul 1, 2007 IP
  4. dpatel304

    dpatel304 Peon

    Messages:
    220
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for both the responses, however, now it looks like this:
    [​IMG]

    I should've clarified it in my first post, my fault. I would like to have the banner within that black border. Any additional help is appreciated.
     
    dpatel304, Jul 1, 2007 IP
  5. PDoc

    PDoc Peon

    Messages:
    47
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    0
    #5
    In that case you should use CSS to pad the banner within the td tag:

    (using ajsa52's modification) by adding padding-top: 5px;
    
    <td style="height:133px; text-align:center; vertical-align:top; padding-top: 5px;"
      <!-- PLACE YOUR AD OR OTHER CODE HERE -->
      $banner
      <!-- /PLACE YOUR AD OR OTHER CODE HERE -->
    </td>
    
    HTML:
    Play around with the values to fit it correctly. (change the 5px to 10px for example)

    Hope that helps/works.
     
    PDoc, Jul 1, 2007 IP
  6. dpatel304

    dpatel304 Peon

    Messages:
    220
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    awesome! 12 seems to be the magic number. Thanks guys. As you can tell, I'm really not too great with code, but this really helped.
     
    dpatel304, Jul 1, 2007 IP