WordPress.org

Ready to get started?Download WordPress

Forums

Ads display in different areas depending on resolution (5 posts)

  1. kzkomputers
    Member
    Posted 2 years ago #

    Hey guys so i have 2 ads and on my 23in 1080p the ads look fine and in the right place but on my bros 19 in with smaller resolutions the banner ad is more to the right. What code do i need so it stays in the same place on all resolutions ?

    heres the site if youd like to look at it
    http://kzkomputers.com/

    thanks and cant wait to fix this. It must look shitty to ppl who visit it and the ads are off.

  2. timDesain
    Member
    Posted 2 years ago #

    open style.css
    add (line 27)
    #header { position: relative; }

    replace inline style in header.php

    <div id="header">
    <div style="width:400px; height:100px; position:absolute; left:35%; margin-top:70px">

    with

    <div id="header">
    <div style="position:absolute;right:0;top:50px;">
  3. kzkomputers
    Member
    Posted 2 years ago #

    ok well this is my code right now in header.php

    <div style="width:400px; height:100px; position:absolute; left:37%; margin-top:70px"><script type="text/javascript"><!--
    google_ad_client = "ca-pub-7004674886429240";
    /* lead */
    google_ad_slot = "8298540578";
    google_ad_width = 728;
    google_ad_height = 90;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script></div>

    thats the ad code that i use now in order to have in centered and aligned where i want it. Now you said to go to style.css and add that code you mentioned. Then replace the script with this <div id="header">
    <div style="position:absolute;right:0;top:50px;"> Would the ad be centered or how would i align it then ?

    Sorry for dumb questions but i just started to learn this.

  4. kzkomputers
    Member
    Posted 2 years ago #

    so this is my header in the style.css

    /*HEADER*/
    #header{ float:left; width:100%;}
    #logo{ margin-top:40px; float:left;}
    #logo a{ color:#424242; text-decoration:none; font-size:40px; float:left;}
    #logo a img{ border:none; float:left;}
    #logo .text_logo{ display:block; padding-top:20px;}
    #logo .desc{ width:auto; float:left; padding-top:10px;}

    what do i replace ? the first #header{ float:left; width:100%;} with #header { position: relative; } ?

  5. kzkomputers
    Member
    Posted 2 years ago #

    i figured it out thanks for the help

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.