Need Help On my Website - Simple CSS Prolem

Discussion in 'CSS' started by calcalmx123, Aug 14, 2009.

  1. #1
    http://rollercoastercrazy.com/theme-parks-uk-pleasure-beach.php
    If your screen resolution is different to mine or you resize the window the address moves, im using position absoulute to do it, what could i use and how.

    
    #address{
    	position:absolute;
    	left:880px;
    	top:345px;
    
    }
    #addressmap{
    	padding:0 0px 10px 45px;
    }
    
    PHP:
    
    <div id="addressmap">
    <img src="http://www.google.co.uk/mapdata?CxWZxDQDHaxX0f8gJQxAjgJIuQFSAkdCkAECygECZW4">
    </div>
    <div id="address">
    525 Ocean Boulevard<br />
    Blackpool, FY4 1EZ<br />
    0870 444 5566<br />
    </div>
    
    PHP:

     
    calcalmx123, Aug 14, 2009 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    To #right, add {position: relative;}. That makes it the nearest positioned ancestor.

    Then do this:
    #address {
      position: absolute;
      right: 10px;
      top: 100px;
      }
    Code (markup):
    That positions it referenced to its containing box, #right.

    cheers,

    gary
     
    kk5st, Aug 14, 2009 IP
    calcalmx123 likes this.
  3. Rasczak

    Rasczak Peon

    Messages:
    131
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Forget abs position here, its obsolete...

    1) move the address into the addressmap div
    2) add float:left to BOTH the image AND the address
    3) set a right margin for the image to pan the address to the right
    4) of course don't forget to CLEAR after these elements...

    cheers...

    pm me if you still have problems
     
    Rasczak, Aug 14, 2009 IP
    calcalmx123 likes this.
  4. calcalmx123

    calcalmx123 Well-Known Member

    Messages:
    1,498
    Likes Received:
    58
    Best Answers:
    0
    Trophy Points:
    195
    #4
    Thanks for the help,
    +REP to you both.
     
    calcalmx123, Aug 14, 2009 IP
  5. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #5
    No quite true. For small positioning jobs like this, it's quite useful.

    cheers,

    gary
     
    kk5st, Aug 14, 2009 IP