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 3 of 3
  1. #1
    New Coder
    Join Date
    May 2012
    Posts
    57
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Fading banner not moving with margin

    Hey

    I have a fading banner on my website. I have a problem with it that its not moving when I try to shift it to its place, it's just stuck top left

    I would appretiate any help!

    Here is my page: www.posterimage.fi/uusi

    Code I used:
    Code:
    <div id="slideshow">
    <div id="fadeshow1">
    <a href=""></a></div> 
    <script type="text/javascript" src="http://www.2createawebsites.com/resources/howtocreateawebsitefadeslide.js"></script>  
    <script type="text/javascript">  
    var mygallery=new fadeSlideShow({   
     wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow   
     dimensions: [446, 96], //width/height of gallery in pixels. Should reflect dimensions of largest image
          imagearray:  [     
          ["http://www.posterimage.fi/uusi/img/slogan1.png"],    
          ["http://www.posterimage.fi/uusi/img/slogan2.png"]// <--no trailing comma after very last image element!   
          ],  
          displaymode: {type:'auto', pause:1000, cycles:0, wraparound:false},   
      persist: false, //remember last viewed slide and recall within same session?   
      fadeduration: 2000, //transition duration (milliseconds)  
      descreveal: "ondemand",
      togglerid: ""
      })
      </script>
    Code:
    #slideshow {
    left: 20;
    position: absolute;
    top: 100px;
    margin-left: 40px;
    }

  • #2
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    You need units for left and you don't really need margin-left for an absolutely positioned element (unless there are other positioned elements nearby).

    Code:
    #slideshow {
    left: 20px;
    position: absolute;
    top: 100px;
    /* margin-left: 40px; */
    }
    Added Note that an absolutely-positioned element will be positioned relative to the body unless it is contained within another positioned element.
    Last edited by AndrewGSW; 08-27-2012 at 10:04 PM.
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • #3
    New Coder
    Join Date
    May 2012
    Posts
    57
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by AndrewGSW View Post
    You need units for left and you don't really need margin-left for an absolutely positioned element (unless there are other positioned elements nearby).

    Code:
    #slideshow {
    left: 20px;
    position: absolute;
    top: 100px;
    /* margin-left: 40px; */
    }
    Added Note that an absolutely-positioned element will be positioned relative to the body unless it is contained within another positioned element.
    Hey

    I tried changing the units, different numbers etc, but the banner is stuck and not moving


  •  

    Posting Permissions

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