I would assume that I can set css classes as such and get an image to appear on part of the page, with the text before or after it. Instead, Kindlegen is separating the image altogether. Does anyone have an idea what is going on or how to solve this?
I hate to be the bearer of bad news, but Kindle currently supports only a (very) limited subset of CSS properties. As you've discovered, it doesn't support floating. I don't believe it supports specifying the size of a DIV, though I haven't specifically tested that. It doesn't support padding. Same with border (except in tables). I rather suspect it doesn't recognise the max-height or max-width properties either. Background colour/shading is, again, only supported inside tables. However only very basic support is provided for tables, so I wouldn't recommend going back to the old web design notion of using tables to layout and format the content.
One thing I've found - if you don't specify the image height and width in the IMG attributes, and the image is smaller than the available display area on the screen, Kindle will expand the image to fill the available display area. If you specify the image height and width in the IMG attributes, and the image is smaller than the available display area, the image will be displayed using the height and width dimensions specified. You could try using percentage values, but don't hold your breath - again, it's not something I've tried, but I rather suspect it won't be recognised. So far, I've only specified image height and width in pixels. If the image is larger than the available display area, it will be adjusted to fit by the Kindle operating system.
Compared to what one can do with EPUB and a high quality EPUB reader, the Kindle is a lot simpler and more basic in what can be achieved with book interior design and layout. It's constantly developing, though, and I expect that what will be feasible 6 months from now will be substantially more than what is currently possible. For now, however, the available options are somewhat limited, and ingenuity is required when formatting anything more than straightforward narrative text.
[i]Are you saying that the only way for your image to be half the screen is by reducing the image dimensions (and not through css)?[/i]
Well, I meant that a horizontal image (in fact, most images are horizontal) will fill the Kindle screen in width but not in height, so there is space beneath it for a caption.
Where possible (that is, unless the picture was so small that it gets pixilated when I enlarge it), I size my images to be 600 pixels wide by whatever height, typically something like 400 pixels.
If it's a strong vertical, then I size it to be 800 pixels tall by whatever width, centered on the page, and I don't caption it.
Of course, this all falls apart if the viewer is using a smartphone held horizontally! Then the horizontal image fills the screen, and the vertical one gets shrunk down and centered with lots of white space on either side.
I really don't think you can dictate image size and location, given the limitations of the Kindle software and the variety of devices people use to read Kindle editions on. The best you can do is design so that it works all right in the majority of cases.
Even if you decide to design just for the Kindle, you can't know that your reader hasn't set his device so that it is read horizontally.
E-ink can do images perfectly well; these are just software issues (and frankly, when I was investigating Mobipocket 2 years ago, I found the same basic problems). It's a shame that mobipocket has such modest support for it.
A quibble. Tall images are a natural fit for the Kindle screen (especially if floating were possible).
I'm designing for epub eink, epub ipad, kindle eink, kindle ipad (not to mention a web-based version).
Now it looks like I'm going to have to re-scale all my images manually for kindle e-ink. I have to wonder whether it's too much trouble to put images in a kindle format..
Interesting discussion, but surely the zoom function
on the Kindle takes care of some of these issues?
I mentioned above that in one case I posted a small image because it looked pixilated when enlarged to 600 pixels wide. On Kindle for PC it showed small. But this morning when I downloaded it to the Kindle reader, behold! It was indeed zoomed to full page. So I took the caption away.