[Resolved] Banner Positioning to Center – Need help to update the code

Home Forums Support Banner Positioning to Center – Need help to update the code

  • This topic has 7 replies, 2 voices, and was last updated 3 months ago by David.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1331084
    Abdul

    Created an element hook and placed the code. am able to see the code but it is not center aligned

    Tried “center”, “aligncenter”, its not working

    <div class="alignleft">
         <script type="text/javascript">
           	amzn_assoc_ad_type = "banner";
    	amzn_assoc_marketplace = "amazon";
    	amzn_assoc_region = "US";
    	amzn_assoc_placement = "assoc_banner_placement_default";
    	amzn_assoc_campaigns = "amazonhomepage";
    	amzn_assoc_banner_type = "rotating";
    	amzn_assoc_p = "48";
    	amzn_assoc_width = "728";
    	amzn_assoc_height = "90";
    	amzn_assoc_tracking_id = "XXX";
    	amzn_assoc_linkid = "XXX";
         </script>
         <script src="//z-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&Operation=GetScript&ID=OneJS&WS=1"></script>
        </div>
    #1331171
    David
    Staff
    Customer Support

    Hi there,

    Try adding this CSS:

    #amznBanners_assoc_banner_placement_default_0_img {
        margin: auto;
    }
    #1331191
    Abdul

    It is not working. I added the code in the additional CSS and it is still in the same left aligned position

    #1331201
    Abdul

    Added a center tag and it is working. trying to fit with the header container size but when i increase the width it again tries to align left. how to fit it to the header container ?

    <center>
    <iframe src="//rcm-na.amazon-adsystem.com/e/cm?o=1&p=48&l=ur1&category=amazonhomepage&f=ifr&linkID=d49dc17e8d25b8445cf65e28e00e59&t=testt-20&tracking_id=testt-20" width="1028" height="90" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe>
    </center>

    thanks

    #1331476
    David
    Staff
    Customer Support

    You can do this:

    <div class="grid-container banner-container">
    <!-- your banner code here -->
    </div>

    And use this CSS to center it:

    .banner-container {
        text-align: center;
    }
    #1331598
    Abdul

    Not working, the banner is in the center now but not similar to the container above (header) it due which it now is in a separate container on its own which does not look good.

    #1331605
    Abdul

    Moved the position to “After header content” now. I think this should be fine now as long as it is inside the container with the header and not hanging separately which does not look nice.

    #1332193
    David
    Staff
    Customer Support

    Glad to hear you found a solution

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.