Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Jun 2008
    Posts
    2
    Member #
    16941
    My coding works in IE, Firefox, and Opera. The problem I have seems to be a small one but I donít know what to use to fix it. Also my background moves when I do this as well. Please look over the code I posted to tell me what might be wrong. Thank you

    <html><title>Home</title>
    <script type="text/javascript">
    <!--
    function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
    function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
    <head>
    <link rel="stylesheet" href="main.css">
    </head>
    <body onLoad="MM_preloadImages('abov.gif','svov.gif','ct ov.gif','hmov.gif')">
    <div id="bg"><img src="bg.gif" width="730" height="220"></div>
    <div id="logo1">TLP</div>
    <div id="logo2">Design/Development</div>
    <div id="gwd">Graphic & Web Design</div>
    <div id="home">
    <a href="index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home','','hmov.gif',1)" ><img src="hmnm.gif" alt="Home" name="home" width="72" height="18" border="0"></a></div>
    <div id="about">
    <a href="about.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('about','','abov.gif',1) "><img src="abnm.gif" alt="About" name="about" width="72" height="18" border="0"></a></div>
    <div id="service">
    <a href="services.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('services','','svov.gif' ,1)"><img src="svnm.gif" alt="Services" name="services" width="72" height="18" border="0"></a></div>
    <div id="portfolio">
    <a href="portfolio.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('portfolio','','ptov.gif ',0)"><img src="ptnm.gif" alt="Portfolio" name="portfolio" width="72" height="18" border="0"></a></div>
    <div id="contact">
    <a href="email.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('contact','','ctov.gif', 1)"><img src="ctnm.gif" alt="Contact" name="contact" width="72" height="18" border="0"></a></div>
    <h1>Welcome to TLP.Com</h1>
    <p>Tlp.com is a new and innovating web design company which utilizes multiple skills and
    programs to create a eye-catching<br> website for any small
    business owner. Along with our
    Web Design and development, TLP.com will also help with other<br> web related marketing
    design. We can build
    your company an array of web banners ranging from still to
    animated. And if<br> your business prefers logos, TLP.com can accomplish that task as well.
    With affordable pricing we can take care of almost<br> any Internet needs.</p>
    <div id="bg1">
    <img src="bg1.gif" width="730" height="220"></div>
    <div id="banner"></div>
    <div id="cnt">
    Copyright 2005<br>
    139 Izaak Walton Rd<br>
    Amherst Va 24521</div>
    <div id="stlf"><a href="privacy.html">Privacy Statement / Legal Disclaimer</a></div>

    </body></html>

    css
    body{
    background:url(another.jpg);
    background-attachment:fixed;
    background-position:inherit;
    background-position:top;
    background-repeat:no-repeat;
    background-color:#000000;
    }
    #logo1{
    position:absolute;
    top:15px;
    left:380px;
    color:#ffffff;
    font-family:"Times New Roman", Times, serif;
    font-size:32px;
    }
    #logo2{
    position:absolute;
    top:55px;
    left:618px;
    color:#ffffff;
    font-family:"Times New Roman", Times, serif;
    font-size:12px;
    }
    #gwd{
    position:absolute;
    top:41px;
    left:818px;
    color:#ffffff;
    font-family:"Times New Roman", Times, serif;
    font-size:18px;
    display:table;
    }
    #about{
    position:absolute;
    top:118px;
    left:447px;
    }
    #home{
    position:absolute;
    top:117px;
    left:363px;
    }
    #service{
    position:absolute;
    top:118px;
    left:532px;
    }
    #portfolio{
    position:absolute;
    top:118px;
    left:616px;
    }
    #contact{
    position:absolute;
    top:118px;
    left:701px;
    }
    #bg{
    position:absolute;
    top:8px;
    left:350px;
    height: 209px;
    display:table;
    }
    #bg1{
    position:absolute;
    top:532px;
    left:350px;
    height: 209px;
    display:table;
    }
    h1{
    position:absolute;
    top:194px;
    left:352px;
    font-family:"Times New Roman", Times, serif;
    font-size:18px;
    color:#ad0000;
    display:table;
    }
    p{
    position:absolute;
    top:247px;
    left:366px;
    font-family:"Times New Roman", Times, serif;
    font-size:14px;
    color:#ffffff;
    display:table;
    }
    #banner{
    position:absolute;
    top:385px;
    left:383px;
    }
    #cnt{
    position:absolute;
    top:686px;
    left:383px;
    font-family:"Times New Roman", Times, serif;
    font-size:12px;
    color:#ffffff;
    display:table;
    }

    #stlf{
    font-family:Times New Roman, serif;
    font-size:10pt;
    position:absolute;
    left:852px;
    top:716px;
    color:#ffffff;
    display:table;
    }
    a:link{
    color:#ffffff;
    text-decoration:none;
    }
    a:hover{
    color:#ff0000;
    text-decoration:none;
    }
    a:active{
    color:#ffffff;
    text-decoration:none;
    }
    a:visited{
    color:#000000;
    text-decoration:none;
    }

  2.  

  3. #2
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    Can you post a link with the images in place, please?

    Can't duplicate background moving if there is no background.

    Also, with regard to the text if you could explain what you expect to be happening it will be easier to explain why it's behaving as it is...

    Sean

  4. #3
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,693
    Member #
    5580
    Liked
    717 times
    absolute positioning is a bad thing for screen resizing.

    I would guess most of your problems lie there.


  5. #4
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    Quote Originally Posted by mlseim
    absolute positioning is a bad thing for screen resizing.

    I would guess most of your problems lie there.
    I suspect you're right...

    There appears to be a huge area on the left that is empty... I'm guessing that this is going to include some image or other which he believes needs to be there, but without seeing the site it's difficult to say.

    But "the site" seems to be behaving as I'd expect it to, when I copied and pasted to my webserver from the post above, so not really sure what

    a. the intention is
    b. the exact issue is

    No doubt we shall find out soon :-)

    Sean

  6. #5
    Junior Member
    Join Date
    Jun 2008
    Posts
    2
    Member #
    16941
    Sorry about that the url is http://216.120.227.52/~tlpdesi/

  7. #6
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Yeah, you're talking about when you un-maximize the screen (which it turns out is not minimizing but `restoring' -- a stroke of genius by the people who originally termed those actions < rolls eyes >), in which case your content is shoved off to the right. That's, as mentioned, because you used absolute positioning and because you did it in pixels. If you'd done it in ems, you would have been better, but in pixels, the number of pixels from the left will always be the same, no matter what the size of the browser window, which will result in your content hanging out off the side of the window.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:30 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com