Inserting an image so it won't move on different size monitors?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AutumnsDecay
    New Member
    • Mar 2008
    • 170

    #16
    Dreamweaver has a 'Code' tab. You'll want to go to that tab and modify the code like so:
    Code:
    <div class="centereddiv">
        <img src="images/your_image_1.jpg" alt="" />
        &nbsp;&nbsp;
        <img src="images/your_image_2.jpg" alt="" />
    </div>
    Obviously, replace 'your_image_' with your image location.

    Comment

    • Sean Watkins
      New Member
      • Jan 2011
      • 48

      #17
      Ok, I see the problem. The background image keeps sliding upon the resizing of the window. Is there a way to stop it from sliding or a way you suggest from this occurring?

      Comment

      • AutumnsDecay
        New Member
        • Mar 2008
        • 170

        #18
        Try removing the 'background-attachment:fixe d;' line from your code and let me know if that helps.

        Comment

        • Sean Watkins
          New Member
          • Jan 2011
          • 48

          #19
          Hmm, The Background is still sliding. here is a direct link to what I am talking about http://www.penciledmemories.com/twodiv.html. When you click on the window and drag it to resize it the background slides to the left and right, while the pictures remain in place. I even tried resizing the background, it still slides.

          Comment

          • Sean Watkins
            New Member
            • Jan 2011
            • 48

            #20
            Sorry forgot to mention, I did delete the background-attachment:fixe d; Portion of the code.

            Comment

            • AutumnsDecay
              New Member
              • Mar 2008
              • 170

              #21
              Try this:

              Code:
               
              
              body {
               background-image: url(/images/buckcollagebg.jpg);
               background-repeat:no-repeat;
               background-attachment:scroll;
               background-position:top center;
               background-color:#fff;
               }

              Comment

              • Sean Watkins
                New Member
                • Jan 2011
                • 48

                #22


                The background seems to still slide from its original position to the right when enlarging the browser window Sir.

                The Images remain in the correct spot on the screen, but due to the background sliding it does throw it off from where it should be on the background.

                Comment

                • Sean Watkins
                  New Member
                  • Jan 2011
                  • 48

                  #23
                  Again I appreciate the help, very much.

                  Comment

                  • Rabbit
                    Recognized Expert MVP
                    • Jan 2007
                    • 12517

                    #24
                    If you're trying to center the background image, it's going to move no matter what because the body will have to recenter whenever it gets resized.

                    What you will probably have to do is use a div to wrap the background image and set a width for that div.

                    Comment

                    • Sean Watkins
                      New Member
                      • Jan 2011
                      • 48

                      #25
                      It doesn't bother me that the background is moving. What I desperately need is the images to remain in the center of that background, even if the background moves I need the images to move along with it. So the images are placed correctly within the background at all times. This is something that can be done right? Thanks guys.

                      Comment

                      • Sean Watkins
                        New Member
                        • Jan 2011
                        • 48

                        #26


                        Current Page for what I am working with.

                        Comment

                        • Sean Watkins
                          New Member
                          • Jan 2011
                          • 48

                          #27
                          I know I have seem CSS templates do it with images, and pages. I just need to have two images centered within the background and even if the resizing occurs the images move along with the background, so everything remains in its correct position.

                          Comment

                          • Rabbit
                            Recognized Expert MVP
                            • Jan 2007
                            • 12517

                            #28
                            Try this:
                            Code:
                            			.centereddiv
                            				{
                            					float:left;
                            					width:50%;
                            				}
                            
                            			.centereddiv2
                            				{
                            					float:left;
                            					width:50%;
                            				}

                            Comment

                            • Sean Watkins
                              New Member
                              • Jan 2011
                              • 48

                              #29
                              Ok, sorry to keep updating my status but I just want to let you guys know where I am. I have figured out how to not make the background move when resizing the browser, only problem now is when I do this, the background and the images are to the uppder left and not centered. I know this is because I have this in the code


                              Code:
                              body {
                              	background-image: url(http://www.penciledmemories.com/buckcollagebg1.jpg);
                              	background-repeat: no-repeat;
                              	background-color: #ffffff;
                              	background-attachment:fixed;
                              
                              }
                              I am aware that I don't have anything telling the background to center, but I am afraid that if I do it will slide again. Any suggestions on how to have it center without it sliding?
                              Last edited by Niheel; Jan 6 '11, 12:20 AM. Reason: codetag

                              Comment

                              • Sean Watkins
                                New Member
                                • Jan 2011
                                • 48

                                #30



                                I inserted the float:left;
                                width:50%;


                                dang background wants to move and the images remain in place. If you think there is any way of doing what I am trying to accomplish other than the way I am doing it, please do tell me. I again appreciate all the help and hard work guys.. thank you

                                Comment

                                Working...