I'm currently trying to get a background image to fill the entire page when I export to PDF. I've tried all sorts of tactics, but there seems to be an impenetrable right margin that I can't escape. I've changed the title page's margins to 0 and also changed the top-right and bottom-right margins 0, but it only impacts every other margin--not the right margin.
Is this a bug, or am I overlooking something obvious? I'm no expert with html/css, so that's quite possible.
This is what I currently have for my css, which is as close as I've gotten to getting it to work:
@page title
{
margin-left: 0in !important;
margin-right: 0in !important;
margin-top: 0in !important;
margin-bottom: 0in !important;
padding: 0px !important;
@top-left
{
}
@bottom-left
{
}
@top-right
{
margin-right:0in;
}
@bottom-right
margin-right:0in;
...
div.titlepage
{
background-image: url("/download/attachments/657195009/title-page.png?api=v2");
page-break-after:always;
background-size: 100% 100%;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center center;
}
FINALLY!
This accomplished what I want:
<div class="titlepage">
<div class=fsTitle>Text</div>
</div>
@page title
{
margin-left: 0in !important;
margin-right: 0in !important;
margin-top: 0in !important;
margin-bottom: 0in !important;
padding: 0px !important;
height:100%;
@top-left
{
}
@bottom-left
{
}
@top-right
{
margin-right:0in;
}
@bottom-right
margin-right:0in;
{
}
}
div.titlepage
{
page:title;
margin-left: 0;
margin-right: 0;
text-align:center;
background-image: url("/download/attachments/657195009/title-page.png?api=v2");
page-break-after:always;
background-size: 100% 100%;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center center;
padding-left:1000px;
Some of this CSS is undoubtedly redundant or unnecessary, but the image fits the page, is centered, and no longer runs up against the right margin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.