I'm trying to create section covers inside an epub. Like covers for individual stories in an anthology, for example.
My problem is the exact same code has different results depending on whether I use it in a blank book I just created, or a html in an existing book.
The code I use is this:
In a blank book, this would allow the image to be centered and vertically stretched to fit the view window while keeping proportions, even when stretching it beyond the full resolution of the image. Which is what I want.
The same code in a blank html file in an existing book, even the exact same html file from the blank book imported into an existing book, results in the image being vertically stretched until it reaches full resolution only.
What's causing the difference? Can anyone help me get the behavior I want in existing books?
My problem is the exact same code has different results depending on whether I use it in a blank book I just created, or a html in an existing book.
The code I use is this:
Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Cover image test</title>
<style>
img {
display: block;
margin: auto;
}
</style>
</head>
<body>
<img alt="Image" src="cover.jpg" />
</body>
</html>The same code in a blank html file in an existing book, even the exact same html file from the blank book imported into an existing book, results in the image being vertically stretched until it reaches full resolution only.
What's causing the difference? Can anyone help me get the behavior I want in existing books?





