03-29-2012, 05:19 AM | #1 |
Enthusiast
Posts: 28
Karma: 10
Join Date: Jun 2010
Device: none
|
Image height in div
Hello,
I have a problem with an image. I have placed a vertical line image in a table with text in the cell next to it. In sigil and if you view the html the vertical line increase and decreases with the lines of text. Once I look at it in ADE though the line takes up the whole page. It seems that ADE takes the image height as 100% as per the code ignoring the <div>. How do I get it to work on ADE? do I have to do something with the div? It needs to be the height of the text in the cell next door no matter how many lines the text wraps to. Here is the code. <div> <table border="0" style="margin-top: 15px;"> <tr> <td style="vertical-align: bottom; width: 10px;"><img alt="vertical line" height="100%" src="../Images/gvline.jpg" width="5" /></td> <td style="vertical-align: top;"><i>You need not leave your room. Remain sitting at your table and listen. You need not even listen, simply wait. You need not even wait, just learn to become quiet, still, and solitary. The world will freely offer itself to you to be unmasked. It has no choice; it will roll in ecstasy at your feet.</i> <small><b>Franz Kafka</b></small></td> </tr> </table> </div> Thanks in advance Soparch |
03-29-2012, 05:27 AM | #2 |
Fanatic
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
|
I'd suggest setting width to 100% instead of height. Height in percent is always tricky in CSS2; It might work if you give the <div> enclosing the table a fixed height, but that doesn't seem to be what you require.
|
Advert | |
|
03-29-2012, 09:21 AM | #3 |
frumious Bandersnatch
Posts: 7,533
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Think like a browser.
100% of what? Of the container element. What's the container element? A <td>. What's the height of the <td>? Just as much as needed to hold its content. What's its content? An <img>. What's the height of the <img>? 100%? 100% of what? ... |
03-29-2012, 09:33 AM | #4 |
Resident Curmudgeon
Posts: 75,899
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Height as a percent works perfectly. I've never had an issue using height="100%". It works perfectly in ADE and Firefox. Using hright with a percent, I've always had the image scale to the correct percent of the screen.
|
03-29-2012, 01:13 PM | #5 | |
Berti
Posts: 1,197
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
|
Quote:
What's about a <td> with a style { border-left: 2px solid black } ???? To to this with an image, the solution SBT suggests (restiction vertical size of the table) seems to be the only way. Last edited by mmat1; 03-29-2012 at 01:20 PM. |
|
Advert | |
|
03-29-2012, 01:18 PM | #6 |
Berti
Posts: 1,197
Karma: 4985964
Join Date: Jan 2012
Location: Zischebattem
Device: Acer Lumiread
|
Did some corrections on quote of my own message, sorry
Last edited by mmat1; 03-29-2012 at 01:21 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
What image height causes images to fill the screen? | karenbryant | ePub | 7 | 01-04-2012 04:23 AM |
Advice about line-height | Julien Pham | Sigil | 2 | 12-22-2011 09:05 AM |
epubcheck doesn't like <div>s | marciarampart | ePub | 8 | 11-27-2011 03:13 AM |
Center a div | marcelo2605 | ePub | 4 | 05-13-2011 07:39 AM |
Max-Height | theducks | Sigil | 6 | 09-02-2010 05:40 PM |