Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: static image

  1. #1
    New Coder
    Join Date
    Nov 2010
    Posts
    16
    Thanks
    9
    Thanked 0 Times in 0 Posts

    static image

    hello

    here is my website

    http://pslab.tk/homewindow.html

    look at two advertisements on right and left sides,
    so what i want to do is when you scorll down page these advertisemens stay in same sreen position.. i tryed use position:fixed; and static commands, on FF looks fine, but IE and OPERA got bad page floating..

    so any ideas how to get same on IE?
    Last edited by sYmaz; 02-16-2011 at 08:25 PM.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,748
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    Hello sYmaz,
    Position: static; can be a pain to get working in some browsers. IE6 in particular can mess it up.
    I only have FF4 and IE8 to test with right now, this works in those two though -
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    html, body {
    	margin: 0;
    	padding: 0;
    	background: #f44d00;
    }
    	#adLeft, #adRight {
    		height: 600px;
    		width: 120px;
    		position: fixed;
    		top: 0;
    		background: #f63;
    	}
    	#adLeft {
    		margin: 0 0 0 -520px;
    		left: 50%;
    	}
    	#adRight {
    		margin: 0 -520px 0 0;
    		right: 50%;
    	}		
    #container {
    	width: 800px;
    	margin: 0 auto;
    	background: url(http://pslab.tk/images/contentwindow-14.jpg);
    }
    </style>
    </head>
    <body>
            <div id="adLeft"></div>
            <div id="adRight"></div>
        <div id="container">
            <p>
                Lorem <br /> ipsum <br /> dolor <br /> sit <br /> amet, <br /> consetetur <br /> sadipscing <br /> elitr <br />, sed <br /> 
                diam <br /> nonumy <br /> eirmod <br /> tempor <br /> invidunt <br /> ut <br /> labore <br /> et <br /> dolore <br /> magna
                Lorem <br /> ipsum <br /> dolor <br /> sit <br /> amet, <br /> consetetur <br /> sadipscing <br /> elitr <br />, sed <br /> 
                diam <br /> nonumy <br /> eirmod <br /> tempor <br /> invidunt <br /> ut <br /> labore <br /> et <br /> dolore <br /> magna
                Lorem <br /> ipsum <br /> dolor <br /> sit <br /> amet, <br /> consetetur <br /> sadipscing <br /> elitr <br />, sed <br /> 
                diam <br /> nonumy <br /> eirmod <br /> tempor <br /> invidunt <br /> ut <br /> labore <br /> et <br /> dolore <br /> magna
                Lorem <br /> ipsum <br /> dolor <br /> sit <br /> amet, <br /> consetetur <br /> sadipscing <br /> elitr <br />, sed <br /> 
                diam <br /> nonumy <br /> eirmod <br /> tempor <br /> invidunt <br /> ut <br /> labore <br /> et <br /> dolore <br /> 
                LAST WORD
            </p>
        <!--end container--></div>
    </body>
    </html>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    sYmaz (02-16-2011)

  • #3
    New Coder
    Join Date
    Nov 2010
    Posts
    16
    Thanks
    9
    Thanked 0 Times in 0 Posts
    aah, thx this what i need. but maybe there is other way to do that? i putted my advrtisement, java script code in DIV tag, so maybe there simple code for this type of positioning my image?



    sorry for bad english

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,748
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    I don't know that I could combine your layout with my example and get it to work. All your tables and absolute positioning are hard to work with.

    You could use that code I gave you as a template for rewriting your site without tables. That's how I would do it.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    sYmaz (02-17-2011)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •