Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

variable height <img>

Options
  • 05-12-2001 2:18pm
    #1
    Registered Users Posts: 8,488 ✭✭✭


    I'm stuck trying to create an image which will expand in height as the page does....

    the page is at http://www.flanagan.ie/Test1/index.html

    I need the right.jpg and left.jpg images to expand as more text is entered on the page. can this be done?


Comments

  • Closed Accounts Posts: 8,478 ✭✭✭GoneShootin


    would you not use cells with a background color ?


  • Registered Users Posts: 8,488 ✭✭✭Goodshape


    no. thats would just be too damn easy :rolleyes:

    ...dont know how I didint think of it, cheers :) .


  • Closed Accounts Posts: 59 ✭✭acidweb


    or you could try adding //height="100%"// to the image tag if you're into that sort of thing.


  • Closed Accounts Posts: 2,922 ✭✭✭Dave


    <td background="whatever.jpg" height="100%"> </td>

    should work


  • Registered Users Posts: 12,309 ✭✭✭✭Bard


    Percentages in the height parameter of an image tag will work in some browsers but are incorrect as far as HTML standards go.

    AFAIK (at 4.20am and tired), there's no way to STRETCH the image in HTML. You can TILE it, by doing the table cell background thing.

    I've just looked at your page... crop each image into a strip of itself and MAKE THEM CELL BACKGROUNDS, gawd-dammit :)


  • Advertisement
  • Closed Accounts Posts: 512 ✭✭✭beaver


    And don't forget to put something (a space?) between your opening and closing TD tags.


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    Percentages in the height parameter of an image tag will work in some browsers but are incorrect as far as HTML standards go.

    Sorry Niall, but it ain't so (4.20am is a fair excuse though). Percentage values in WIDTH and HEIGHT attributes are perfectly acceptable in the IMG tag.

    adam


  • Registered Users Posts: 8,488 ✭✭✭Goodshape


    height=100% dosint work.

    ...from experience, setting a tiled background dosint work in some browsers.. the image dosint seem to know when to start (ie. it tiles from the edge of the page rather than the cell, totaly out of sync)

    ...i'll go with the bgcolor option...


  • Closed Accounts Posts: 512 ✭✭✭beaver


    Using that on a site I'm developing at the moment (Galway Independent). It's for the black vertical line that runs down the right hand side of the bank of links on the left. Here's the code:
    <td width='1' height='100%' bgcolor='#000000'>
    <IMG src='images/pixel_black.gif' width='1' height='2' alt=''>
    </td>
    

    HTH.

    Is that Mike BTW?

    -Ross


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    height=100% dosint work.

    Tiling an image in the TD works for every browser I've used in the past several years, as long as you don't use it as the background element of a whole table. You just have to make sure the TD has a fixed width, and other TD's don't interfere with it. Your centre TD will interfere with tiling in the outer TD's because you have the width set to 100%.

    adam

    <Spelling. Anal Retentive. Hey, where's my chair?>


  • Advertisement
  • Closed Accounts Posts: 512 ✭✭✭beaver


    True. Your page with isn't fluid anyway, so there's no need to set the width of that TD to 100%.

    The easiest (not best) way to do what you're doing would be to create one table like this:
    [size=1]
    <TABLE width='562'>
    
    <TR>
    <td colspan='3'><IMG src='topimage.gif'></td>
    </TR>
    
    <TR>
    <td height='100%' background='images/left.gif'><IMG src='images/left.gif' width='10' height='2'></td>
    <td width='542'>blah blah blah</td>
    <td height='100%' background='images/right.gif'><IMG src='images/right.gif' width='10' height='2'></td>
    </TR>
    
    <TR>
    <td colspan='3'><IMG src='bottomimage.gif'></td>
    </TR>
    
    </TABLE>
    [/size]
    


  • Registered Users Posts: 12,309 ✭✭✭✭Bard


    Originally posted by dahamsta
    Percentages in the height parameter of an image tag will work in some browsers but are incorrect as far as HTML standards go.

    Sorry Niall, but it ain't so (4.20am is a fair excuse though). Percentage values in WIDTH and HEIGHT attributes are perfectly acceptable in the IMG tag.

    adam

    Say it ain't so...!

    Oh... it is so. Darn.

    Ok- I admit ... I was wrong.

    Strange though, - I was always led to believe that percentages were not allowed in the width and height attributes of IMG tags under HTML standards, - and so I never used them (and still got great results ;) ) ... - it IS true that it may not have the desired effect in some browsers... although don't ask me which browsers :rolleyes:

    Ahhhmmm... it's better practise to use a table background in this example anyway, so nyah... :p

    *cough*


  • Registered Users Posts: 8,488 ✭✭✭Goodshape


    after all that lovly advice, I didint even use the image :rolleyes:
    Originally posted by Gone Shootin
    would you not use cells with a background color ?

    ...yes, I would :: http://www.flanagan.ie/


    and yes, it is michael; how the hell u doin ross? :)


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    Ok- I admit ... I was wrong.

    Yowsa! :)

    I was always led to believe that percentages were not allowed in the width and height attributes of IMG tags under HTML standards, - and so I never used them

    Just because the W3C says it's ok doesn't mean it's a good idea. Look at all the "homepages" out there with scaled banners. Yuk!

    adam


  • Closed Accounts Posts: 1 bazoukie


    I've gotta say, whay would you want to do this?

    Surely it's Bad design to have stretchy images. Good design is built into the guidelines, if you follow them you won't go wrong.

    Good design tips:
    http://www.webmonkey.com
    http://www.yendo.com

    Barry


  • Registered Users Posts: 12,309 ✭✭✭✭Bard


    Originally posted by bazoukie

    Surely it's Bad design to have stretchy images.

    I agree with this... it IS bad design.

    I believe Adam probably agrees with it (in principle) too :)


Advertisement