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

Thread: Html Image help

  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Html Image help

    Code:
    <html>
    <head>
    
    <title>Page Title</title>
    </head>
    <body background="Background/edv_iframebackground.png"> 
    
    <img src="Members/edv_members.png" alt="membername" style="position:absolute; top:0; left:0;>
    
    <img src="Members/edv_members.png" alt="membername" style="position:absolute; top:100; left:384;>
    
    
    <img src="Background/edv_iframebottom.png" alt="bottom" style="position:absolute; top:70%; left:0; width:753; height:300;"> 
    
    </body>
    </html>
    This code is supposed to draw two images side by side same image starting at the top left of the screen. but it doesn't work any idea?

  • #2
    Regular Coder
    Join Date
    Dec 2005
    Posts
    149
    Thanks
    12
    Thanked 0 Times in 0 Posts
    Hi,

    Would you be able to upload a copy online, or you can post an image of how you want it to be in pain for example.

    THank you
    Tomorrow Could Be Your Day

  • #3
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    This code is supposed to draw two images side by side same image starting at the top left of the screen. but it doesn't work any idea?
    For starters, you haven't closed the quotes:

    Code:
    <img src="Members/edv_members.png" alt="membername" style="position:absolute; top:0; left:0;>
    should be

    Code:
    <img src="Members/edv_members.png" alt="membername" style="position:absolute; top:0; left:0;">
    - and the same for the other image. However, that still isn't going to have two images side by side. You are using absolute positioning here, and what it's saying at the moment in the absence of anything else on the page, is put the first image in the top left hand corner of the screen, and the second 100px down from the top of the screen and 384 px to the right. So they're not going to line up horizontally.

    If you have to use absolute positioning, then your second image needs to have top:0 to line up with your first.

    There are a number of downsides of using absolute positioning, not least because if you have any other content on your page, there's a good chance that your absolute positioning will overlay your other content when you don't want it to - because it'll always stay in the same place no matter what size the browser window is etc. As per Genie1's post, an link to your page or more explanation on what you're trying to do might help people suggest a better alternative.

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Also there's no unit specified in your
    Code:
    style="position:absolute; top:100; left:384;
    . There should be a px/pt/em/% unit after the value.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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