View Single Post
Old 07-02-2011, 04:30 AM   #7
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,556
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Adjust View Post
What if you made the image 600x860 and then set the height to 100%.
Wouldn't that resize itself to whatever screen size or orientation?
If it worked, it would be less than optimal, since it wouldn't take the whole width.

But the problem, in my experience, is that it is not clear what "height: 100%" means. We would like it to be "the whole usable screen height", but in the ePUB format (and in the way it is interpreted by the reading software) this is not the case, there is no concept of "screen", and it rather refers to the height of the containing element, which is often not defined. Say you have something like:

Code:
<html>
<body>
<div><img src="cover.jpg" alt=""/></div>
</body>
</html>
... and you say in CSS "img {height: 100%}". That means the img's height will be the same as the div's, but what is the div's height? It's the height needed to contain the img . Then you say "div {height: 100%}". Now the div's height is defined, it's the same as the body's. Same problem. So you say "body {height: 100%}", and then "html {height: 100%}", and expect it to mean "the same as the usable screen space". But I don't see anything in the spec saying that this is so, and even if there were, it is not something that is widely supported/implemented. It may work in some reader, it may break uglily in some other.
Jellby is offline   Reply With Quote