screen center

Discussion in 'Javascript' started by Brian Wilson, May 17, 2004.

  1. Brian Wilson

    Brian Wilson Guest

    Could someone help me with how I could move the box, in the body portion of
    this page, to center of the screen? I was wondering if the
    "screen.availHeight, screen.availWidth" would be a possibility:



    <head>
    <script>
    document.write("<div style='position:absolute; display:block; top:15;
    left:160; width:4; height=345'><img src=vertcolons.gif width=1 height=350
    alt= border=0></div>");
    </script>
    <style>
    BODY, TD {
    color : #666699;
    font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-size: 11px;
    text-align: right;
    margin-right:0px;
    font-style : normal;
    }

    ..navlink { color: #D66000; text-decoration:none; padding : 3px 4px 3px 4px;
    margin : 2px; border-style : solid; border-width:1px; border-color :
    #e1e1e7; }
    ..navlink:hover { color: #D66000; background-color : #F1F1F6; border-style :
    solid; border-width:1px; border-color: #F7F7FF #d1d1d1 #d1d1d1 #F7F7FF; }

    A:link, A:active { text-decoration : none; color : #666699;}
    A:hover { text-decoration : none;}
    A:visited { text-decoration : none; color : #666699;}

    pagetitle {font-size:11px; font-weight:bold; padding:4px;}
    ..pagecontent {position:absolute; display:block; top:10px; left:160px;
    text-align:left; width:620px;}

    ..boxtitle {
    position:relative;
    display : block;
    background-color:#4A6BDE;
    color:#F9F9F9;
    width:100%;
    height:19px;
    padding:3px 3px 0px 3px;
    font-size:10px;
    font-weight : bold;
    border-style:solid;
    border-color:#888899;
    border-width:0px 0px 1px 0px;
    }
    ..boxleft {position:absolute; display:block; top: 5px; left: 2px;
    width:200px; border: 0px #505050 solid;}
    ..boxfooter {
    position:absolute;
    display : block;
    background-color:#42B5DE;
    color : #F9F9F9;
    width:100%;
    height:16px;
    padding:1px 6px 2px 3px;
    font-size:10px;
    text-align : right;
    border-style:solid;
    border-color:#B0B0B0;
    border-width:1px 0px 0px 0px;
    bottom:0px;
    }

    </style>
    <script>

    // Titleline //

    function pagelayout() {
    document.write("<div id=primelinks style='position:absolute; display:block;
    top:px; left:10px; text-align:left;'>");

    document.write("<p><a href=index.html class=navlink
    style='width:140px;'>Home</a><br>");
    /*
    document.write("<a href=planoverview.html class=navlink
    style='width:140px;'>Pricing Plans</a><br><br>");
    */
    document.write("<a href=approach.html class=navlink
    style='width:140px;'>Design Approach</a><br>");
    document.write("<a href=whyus.html class=navlink style='width:140px;'>Why
    Use Us?</a><br>");
    document.write("<a href=cost.html class=navlink style='width:140px;'>Others
    Charge Less</a><br>");
    document.write("<a href=aboutme.html class=navlink
    style='width:140px;'>About the Designer</a><br>");
    document.write("<a href=samples.html class=navlink
    style='width:140px;'>Sample Sites</a><br>");
    document.write("<a href=contact.html class=navlink
    style='width:140px;'>Contact Us</a><br>");
    document.write("<a href=aboutme.html class=navlink
    style='width:140px;'>Extra 1</a><br>");
    document.write("<a href=samples.html class=navlink
    style='width:140px;'>Extra 2</a><br>");
    document.write("<a href=contact.html class=navlink
    style='width:140px;'>Extra 3</a><br>");

    document.write("</div>");
    document.write("</div>");
    }
    </script>

    <script language="JavaScript">pagelayout();</script>
    <title>Sites</title>
    </head>
    <body background="defaultback_flash2.jpg">

    <body>
    <script language="JavaScript">pagelayout();</script>
    <div class="pagecontent">
    <div style="position:absolute; display:block; top:12px; left:10px;
    padding-top:0px; width:190px; height:180px; border: 1px #505099 solid;">
    <div class="boxleft" style="width:180;height:13"><br>

    </div>

    </body>
    Brian Wilson, May 17, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg Cyrus
    Replies:
    5
    Views:
    2,626
    Patrice
    Oct 1, 2004
  2. terry
    Replies:
    0
    Views:
    908
    terry
    Sep 11, 2003
  3. Tom Parson
    Replies:
    16
    Views:
    51,861
    Kent Paul Dolan
    Nov 24, 2005
  4. Eirik Eldorsen
    Replies:
    17
    Views:
    12,464
    cosmic foo
    Aug 4, 2005
  5. Replies:
    17
    Views:
    1,570
    acorn
    Dec 1, 2005
Loading...

Share This Page