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
  1. #1
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts

    Question Float Image to Upper Right Corner

    I should be able to figure it out, but how would one go about floating or positioning an image to the upper right corner of a page. I know an x,y type thing wouldn't do, because it wouldn't be all the way to the right in larger resolutions...at least I don't think so. I don't want the image to move with the page, so no to a static positioning...anyone know how I can accomplish getting my picture in the upper right?

    Thanks.

  • #2
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    *sigh* That should have been obvious to me.

    <span style="position:'absolute'; right:'10'; top:'10'"><img border="0" src="image.jpg"></span>

    I always used left and top to position...change 'left' to 'right' and it starts from the other side. Well, answer here for anyone who searches for this sometime later.

  • #3
    Regular Coder
    Join Date
    Oct 2002
    Posts
    380
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not sure why you need a span. Why not apply the style to the image itself?
    Code:
    <img style="position: absolute; right:10px; top:10px; border:none;" src="image.jpg">
    Alternatively, you could use the float property, with padding:
    Code:
    <img style="float:right; padding-right:10px;padding-top:10px;" src="image.jpg">
    The float will allow you to wrap text around the image a little more nicely.

  • #4
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    Hmm, I'm not sure either, heh. Thanks...I'll change that. I did fiddle with the float property, but just went with absolute positioning...fit my fancy just fine.


  •  

    Posting Permissions

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