javascript - Center Image ad content coming from Java script -


i using following html code load ad server, want display @ center, i'm using styles got internet nothing working.

it displayed @ right corner , must responsive , @ center

    <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">     <html>     <head>     <style type="text/css">     html, body {     width:100%;     height: 100%;     margin: 0px;     padding: 0px;  // code got center content     max-width: 100%;     max-height: 100%;     margin: auto;     overflow: auto;     position: fixed;     margin-left: auto; margin-right: auto;      }       </style>     </head>     <body>  <!-- script loads ad -->     <script type='text/javascript'>     var age = "23";     var gender="male";     //var location1="testifying";         var m3_u = (location.protocol=='https:'?'https://openxtest.wfihotspotnet.in/delivery/ajs.php':'http://openxtest.wfihotspotnet.in/delivery/ajs.php');        var m3_r = math.floor(math.random()*99999999999);        if (!document.max_used) document.max_used = ',';        document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);        document.write ("?zoneid=6");        document.write ("&amp;targender=");        document.write ('&amp;cb=' + m3_r);        if (document.max_used != ',') document.write ("&amp;exclude=" + document.max_used);        document.write (document.charset ? '&amp;charset='+document.charset : (document.characterset ? '&amp;charset='+document.characterset : ''));        document.write ("&amp;loc=" + escape(window.location));        if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));        if (document.context) document.write ("&context=" + escape(document.context));        if (document.mmm_fo) document.write ("&amp;mmm_fo=1");        document.write ("'><\/scr"+"ipt>");     </script>      </body>     </html> 

js fiddle demo

whats wrong in code, in advance

just wrap ad div, , make div center.

.myad{     width: 310px;     margin:0 auto; } 

http://jsfiddle.net/ezved/1/


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -