Psst... Ready to join TalkBass and start posting, make new friends, sell your gear, and more?  Register your free account in 30 seconds.

help with HTML

Discussion in 'Off Topic [BG]' started by Phat Ham, Jan 26, 2004.


  1. Phat Ham

    Phat Ham

    Feb 13, 2000
    DC
    http://www.people.virginia.edu/~hbm3d/chaser/thumbs.html

    I want the pictures to open in a new window that is the exact size of the picture. I get a new window to open, and it is the right size, but on windows machines the picture is offset a little from the top and left, and the bottom and right of the picture get cut off. How do I get the border to go away?
     
  2. tappel

    tappel

    May 31, 2003
    Long Island, NY
    I don't have an answer for you, but I wouldn't be surprised is this was something that CSS positioning, or some other CSS property, could fix.

    Tom
     
  3. Just make it so that it opens into a new window using target="_blank" and don't bother with trying to make it fit the window.
     
  4. You have much to learn, my young padawans. :rolleyes:

    Just make the window 20 pixels wider and 25 pixels higher than the photo, and it's nicely centered. So if the photo is 800x600, make the window 820x625.
     
  5. Phat Ham

    Phat Ham

    Feb 13, 2000
    DC
    The thing is, on macintosh machines (such as my powerbook), everything works the way it's supposed to. How come windows machines have to add that stupid border?
     
  6. tappel

    tappel

    May 31, 2003
    Long Island, NY
    Or... if you don't want any borders or margins, you can link to sepatate html page (rather than a picture) and force zero margins with a CSS style in the head section:

    Note: This isn't PHP. CODE didn't show in preview

    PHP:
    <html>
    <
    head>
    <
    title></title>

    <
    style type="text/css">
    body {margin-left0margin-top0;}
    </
    style>

    </
    head>
    <
    body>

    <
    img src="bone1.jpeg" width="618" height="491" border="0">

    </
    body>
    </
    html>
    It works; I tried it.

    Tom
     
  7. tappel

    tappel

    May 31, 2003
    Long Island, NY
    That's Windows for you. Zero margins is the default, yet if you "force" it, it works.

    Tom
     
  8. Phat Ham

    Phat Ham

    Feb 13, 2000
    DC
    thanks. That's exactly what I needed. One question though. Is it necessary to set the image size, since the window is already the size of the image?
     
  9. tappel

    tappel

    May 31, 2003
    Long Island, NY
    Not necessary, but you should do it. It's good form to add width and height to an IMG tag and you should get used to doing it. It removes any chance of the browser resizing it to its liking.

    Tom