SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    ********* Streaker Lister14's Avatar
    Join Date
    Jun 2002
    Location
    C:\Documents and Settings\Desktop\Recycle Bin
    Posts
    677
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    picture in a frame

    how do you position a picture inside a frame in such a way, that no matter what size the frame has got, it will always be centered from the top to the bottom?
    roy.lu
    C:\DOS... C:\DOS\RUN... RUN\DOS\RUN...!

  2. #2
    SitePoint Addict
    Join Date
    Feb 2001
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
    <tr><td height="100%" align="center"><img src="yourPicture.gif"></td></tr>
    </table>

    or

    <div style="width:100%;height:100%;text-align:center">
    <img src="yourPicture.gif" height="100" style="position:relative; top:50%; margin-top:-50px; margin:auto">
    </div>

  3. #3
    ********* Streaker Lister14's Avatar
    Join Date
    Jun 2002
    Location
    C:\Documents and Settings\Desktop\Recycle Bin
    Posts
    677
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    alright, but the picture needs to be the background...
    just the way it would automatically resize when done in a table
    roy.lu
    C:\DOS... C:\DOS\RUN... RUN\DOS\RUN...!

  4. #4
    SitePoint Zealot Med's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i guess this should work

    <BODY style ="background-image: url(images/yourimage.gif); background-repeat: no-repeat; background-position: center center"></BODY>

    ][ Med

  5. #5
    ********* Streaker Lister14's Avatar
    Join Date
    Jun 2002
    Location
    C:\Documents and Settings\Desktop\Recycle Bin
    Posts
    677
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    will let you know if it worked...
    ...need to go now
    roy.lu
    C:\DOS... C:\DOS\RUN... RUN\DOS\RUN...!

  6. #6
    ********* Streaker Lister14's Avatar
    Join Date
    Jun 2002
    Location
    C:\Documents and Settings\Desktop\Recycle Bin
    Posts
    677
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, that worked quite well for the centering, but it does not resize with the window...

    anyways, changed a little on my idea and won't need it to resize no more, thanx for your help guys anyway...
    roy.lu
    C:\DOS... C:\DOS\RUN... RUN\DOS\RUN...!


Bookmarks

Posting Permissions

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