How to align Advertising code !

Discussion in 'Programming' started by denyo, Jul 17, 2008.

  1. #1
    Hello,

    I am trying to align to center of my table the adbrite code with no luck ! Althought for adsense the <P align..... is working i cant find a way to cente adbrite code ! Can you please help me with that, as its ruining all my template view.


    Thanks in advance
     
    denyo, Jul 17, 2008 IP
  2. LogicFlux

    LogicFlux Peon

    Messages:
    2,925
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
      <div style="width:600px; background-color:gray; text-align:center;">
        <div style="width:400px; background-color:yellow; margin:auto;"></div>
      </div>
    
    Code (markup):
    That generally works whether or not both containers are divs or not. I think they both need to be block level elements.
    At least this is the way I do it. I give the outer block level container a width(greater than that of the inner container) and text-align value of "center".
    Then I make in the inner container less wide than the outer container and give the margin property a value of "auto".
     
    LogicFlux, Jul 17, 2008 IP
  3. denyo

    denyo Well-Known Member

    Messages:
    142
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    123
    #3
    
    <script type="text/javascript">
       var AdBrite_Title_Color = '0000FF';
       var AdBrite_Text_Color = '000000';
       var AdBrite_Background_Color = 'E6E6E6';
       var AdBrite_Border_Color = 'FFFFFF';
       var AdBrite_URL_Color = '008000';
    </script>
    <script src="http://ads.adbrite.com/mb/text_group.php?sid=DELETED" type="text/javascript"></script>
    <div><a target="_top" href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=DELETED&afsid=1" style="font-weight:bold;font-family:Arial;font-size:13px;">Your Ad Here</a></div>
    <!-- End: AdBrite -->
    
    Code (markup):
    Thanks for your reply, can you please be a little more specific ? Where do i have to put the div code? The area is 400px wide and the ad code i am putting is 350px wide.

    Thanks in advance
     
    denyo, Jul 18, 2008 IP
  4. marinaroz

    marinaroz Member

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    Have you tried sticking <center></center> tags around it? I never seen them AdBrite ads, still, it might work.
     
    marinaroz, Jul 18, 2008 IP
  5. LogicFlux

    LogicFlux Peon

    Messages:
    2,925
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Maybe this?

    
    
    <div style="width:400px; text-align:center;">
    
      <script type="text/javascript">
         var AdBrite_Title_Color = '0000FF';
         var AdBrite_Text_Color = '000000';
         var AdBrite_Background_Color = 'E6E6E6';
         var AdBrite_Border_Color = 'FFFFFF';
         var AdBrite_URL_Color = '008000';
      </script>
      <script src="http://ads.adbrite.com/mb/text_group.php?sid=DELETED" type="text/javascript"></script>
      <div style="width:350px; margin:auto;"><a target="_top" href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=DELETED&afsid=1" style="font-weight:bold;font-family:Arial;font-size:13px;">Your Ad Here</a></div>
      <!-- End: AdBrite -->
    
    </div>
    
    Code (markup):
     
    LogicFlux, Jul 18, 2008 IP
  6. denyo

    denyo Well-Known Member

    Messages:
    142
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    123
    #6
    LogicFlux it didnt worked :(

    see what i mean here : h**p://www.mixed.gr/index.php?option=com_seyret&Itemid=2&task=videodirectlink&id=2688

    you can see the adbrite ads right below the video area
     
    denyo, Jul 19, 2008 IP
  7. LogicFlux

    LogicFlux Peon

    Messages:
    2,925
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Doesn't look like the adbrite ads are showing up for me. I can see the code in the source but not the ads on the page.

    Anyway, you didn't put the inline style into the inner div.

    
    <div><a target="_top" href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=761073&afsid=1" style="font-weight:bold;font-family:Arial;font-size:13px;">Your Ad Here</a></div>
    
    Code (markup):
    should be

    
    
    <div style="width:350px; margin:auto;"><a target="_top" href="http://www.adbrite.com/mb/commerce/purchase_form.php?opid=761073&afsid=1" style="font-weight:bold;font-family:Arial;font-size:13px;">Your Ad Here</a></div>
    
    Code (markup):
     
    LogicFlux, Jul 19, 2008 IP
  8. denyo

    denyo Well-Known Member

    Messages:
    142
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    123
    #8
    Well its both adsense and adbrite on the same adbrite code ! I changed to the settings :( you told me but nothing !

    WOOOOOOOO,, its just doesnt work !
     
    denyo, Jul 19, 2008 IP
  9. LogicFlux

    LogicFlux Peon

    Messages:
    2,925
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Change this

    <div style="width:350px; margin:auto; background-color:gray; text-align:center;">

    to this


    <div style="width:350px; margin:auto; background-color:gray; text-align:center;">

    Just put in the text-align:center; . And you can take out or change the background-color property, I just did that because it gives a good visual of what space the element takes up on the page.

    If you want the text inside the box to be left aligned then you can put another div inside this div and set the text-align on that div to text-align:left;
     
    LogicFlux, Jul 19, 2008 IP
  10. denyo

    denyo Well-Known Member

    Messages:
    142
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    123
    #10
    Really nice with the grey colour, i changed that tried possible variations and placements of the div , i get the Your ad here alligned but not the ad script itself
     
    denyo, Jul 19, 2008 IP
  11. LogicFlux

    LogicFlux Peon

    Messages:
    2,925
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #11
    It centers in IE7 pretty much how it's supposed to. I don't know why it's not working in FF. I assume you're using FF too?

    I think you might have to center the content in the iframe since that's where the ad is being displayed from.(and you'll probably have to do that by scripting the DOM)
    I've tried putting a div directly around the script that inserts the iframe and playing with its text-align and margin properties with no luck.

    I don't know what else to try, I usually fix problems like this by trying stuff until I get lucky. :)
     
    LogicFlux, Jul 19, 2008 IP
    denyo likes this.
  12. denyo

    denyo Well-Known Member

    Messages:
    142
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    123
    #12
    yes i was using Firefox ! I tried with explorer and everything appears ok !

    I give up mate, :D This is totally crap, trying to allign a ad code for the past 2 days ! hahaha!

    Thanks a lot for your help, reputation given
     
    denyo, Jul 19, 2008 IP
  13. LogicFlux

    LogicFlux Peon

    Messages:
    2,925
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #13
    LogicFlux, Jul 19, 2008 IP