Need Centering

Discussion in 'PHP' started by primster7, Nov 9, 2013.

  1. #1
    How would I center this code:

    I tried the <center></center> but it doesn't work.

    $results .= "<div id='eb_item'>
    <div class='item_title'><a id= 'out' href=\"http://rover.ebay.com/rover/1/711-53200-19255-0/1?campid=$ebay_id&toolid=10013&mpre=" . $item->ViewItemURLForNaturalSearch . "\" target='_blank' rel='nofollow'>" . $item->Title . "  </a></div>";
    $results .= "<div class='item_image'><a id= 'out' href=\"http://rover.ebay.com/rover/1/711-53200-19255-0/1?campid=$ebay_id&toolid=10013&mpre=" . $item->ViewItemURLForNaturalSearch . "\" target='_blank' rel='nofollow'><img src=\"$item->GalleryURL\" alt=\"$item->Title \" width=100 height=95></a></div> \n";
    $results .= "<div class='currprice'>"  ;
    $results .= "<span id='wbar'><b>Price:</b></span> <span id='pricebar'> $" . $ConvertedCurrentPrice. "</span></div>\n";
    $results .= "<div class='ends'></div><br><div>
    <a id= 'out' href=\"http://rover.ebay.com/rover/1/711-53200-19255-0/1?campid=$ebay_id&toolid=10013&mpre=" . $item->ViewItemURLForNaturalSearch . "\" target='_blank' rel='nofollow'><img src='../images/details.gif' border=0 alt=''></a></div><br>\n";
    $results .= "</div>\n";
    PHP:
     
    primster7, Nov 9, 2013 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    This isn't really a PHP question, but:
    
    style="width: xxx; margin: auto;"
    
    Code (markup):
     
    nico_swd, Nov 9, 2013 IP
  3. Hostix

    Hostix Well-Known Member

    Messages:
    467
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    165
    #3
    In the CSS find
    and put
    margin: 0 auto;
    Code (markup):
     
    Hostix, Nov 9, 2013 IP
  4. primster7

    primster7 Well-Known Member

    Messages:
    801
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    110
    #4
    Thanks a lot.
     
    primster7, Nov 9, 2013 IP