06-25-2011, 08:17 AM | #1 |
Zealot
Posts: 104
Karma: 20
Join Date: Jun 2011
Location: County Down, Northern Ireland
Device: none
|
Hello/Image and text alignment
Hello. Sorry if I'm posting this in the wrong place, and if it's been dealt with umpteen times before, but I'm new to the forum.
I'm trying to align text with an image, so that the image appears on the left and the text vertically aligns with the center of the image. I have fiddled about with various methods, but to no avail. It would also be handy to have a solution that would work with .prc for Kindle and .epub files. Any suggestions would be gratefully received. Ta! |
06-25-2011, 09:13 AM | #2 |
Zealot
Posts: 104
Karma: 20
Join Date: Jun 2011
Location: County Down, Northern Ireland
Device: none
|
vertical-align code
Maybe to make my meaning a little clearer I should provide the code I have tried:
p.noindent {text-indent:0em;} p.traffic {text-indent:0em; font-size:140%;} img.traffic {vertical-align:middle;} <p class="traffic"><img class="traffic" src="Getting-Started-3.jpg" alt="" width="40" height="40" />Red Light Foods</p> <p class="noindent">High GI and high calorie foods. Do not eat these if you want to lose weight.</p> <p class="traffic"><img class="traffic" src="Getting-Started-4.jpg" alt="" width="40" height="40" />Yellow Light Foods</p> <p class="noindent">Mid-range GI foods. Eat these when you have reached your target weight.</p> <p class="traffic"><img class="traffic" src="Getting-Started-5.jpg" alt="" width="40" height="40" />Green Light Foods</p> <p class="noindent">These are low GI, low in calories and low in saturated fat. Eat these if you want to lose weight. Low GI foods make you feel fuller for longer and reduce the craving for that fattening sugar fix.</p> I am trying to get the text to align with the middle of the image, but the vertical-align isn't working in the Kindle Previewer. Am I making a fundamental mistake in the code, or does Kindle not support vertical align in css? If it doesn't, is there a simple fix to this? |
Advert | |
|
06-25-2011, 05:37 PM | #3 |
PORTAL
Posts: 7,204
Karma: 2884640
Join Date: Apr 2010
Device: Kindle 1, Kindle 3 (3G), iPhone
|
Hello and welcome to MR!
Imogen |
06-26-2011, 10:47 AM | #4 |
Zealot
Posts: 104
Karma: 20
Join Date: Jun 2011
Location: County Down, Northern Ireland
Device: none
|
Thank you! I'm going to need it!
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-650 Text and alignment issues | henders254 | Sony Reader | 0 | 05-14-2011 08:11 PM |
Text Alignment Problem | fan of kovid | Conversion | 15 | 03-20-2011 05:39 PM |
Please help with RSS feed text alignment / justification | zoilom | Recipes | 0 | 01-09-2011 12:23 PM |
Text alignment | James_Wilde | iRiver Story | 0 | 10-25-2010 04:22 AM |
text and image | pimpoum | 2 | 05-31-2009 04:26 AM |