how to manipulate a background in absolute div

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Natalia Usselman
    New Member
    • Aug 2010
    • 4

    how to manipulate a background in absolute div

    I have this layout that is coming together, except for one absolutely positioned div (id="dancers")w hich is inside a relatively positioned "container" div.

    http://www.tangobarok. com/new/

    link to css - http://www.tangobarok. com/new/main.css

    whenever I try to position it more to the right and lower with {top: 40px;}the contents of div itself moves, but the background of it doesn't. Therefore the dancers background gets cut off. I thought the background was relative to the div it's in?

    Thank you for your help!

    Natalia.
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    your dancer div is relative to Container div.

    and dancer div's default left and top is set to zero(infiact you didnt set any). if you want to move your dancer div to the left of container div you need to set left value to negative. Try this and let us know :)

    Comment

    • Natalia Usselman
      New Member
      • Aug 2010
      • 4

      #3
      that's the problem I was trying to describe - when I set the position, the div itself moves



      (see the blue word hello), and the background doesn't.

      Comment

      • Natalia Usselman
        New Member
        • Aug 2010
        • 4

        #4
        I am guessing it's because the background is "fixed". I just didn't realize it would be fixed to the body of the document and not a browser window.

        Comment

        • johny10151981
          Top Contributor
          • Jan 2010
          • 1059

          #5
          I made a little experiment for you.

          well got the solution;
          add another style to container Div

          Code:
          overflow:visible
          if you add this to container then you will be able to see the whole picture on the left; otherwise you cant. The reason is the image you want to see is a background to the dancer div so, when you are moving it to left you cant see some part.

          Comment

          • Natalia Usselman
            New Member
            • Aug 2010
            • 4

            #6
            sorry, overflow:visibl e does not do anything. There is no overflow, the background is not a part of the content

            Comment

            • johny10151981
              Top Contributor
              • Jan 2010
              • 1059

              #7
              i know you didnt add overflow. i am asking you to add overflow and see what happen

              Comment

              • johny10151981
                Top Contributor
                • Jan 2010
                • 1059

                #8
                Sorry You are right,
                Its not working. I am trying to figure it out :)

                Comment

                • johny10151981
                  Top Contributor
                  • Jan 2010
                  • 1059

                  #9
                  You got it right about background-attachment
                  the link explained it very well.

                  But cant give you a real solution for what you need :(

                  Comment

                  • JKing
                    Recognized Expert Top Contributor
                    • Jun 2007
                    • 1206

                    #10
                    Remove background-attachment.

                    Are you still having trouble positioning the div?

                    Comment

                    Working...