开发者

Print a div inside a div

I have a print.css file. I kind of figured out how to get the div I want to print to show up with everything else not displayed. Problem I am having is when I go to print preview i seem to have some lines missing when there is more than one page to print. Here is my print.css file:

/* Remove unwanted elements */
#map_canvas, #nav, #wb_header, #wb_outline, #wb_navoutline, #wb_Image1, #wb_Text2, #wb_Image2, #wb_Text1, #wb_Text3, #wb_Text4, #wb_Text5, #wb_Text6, #wb_Text7, #wb_Text8, #wb_Text9, #wb_Text10, #wb_Text11, #wb_Text12, #wb_Text13, #wb_Text14, #wb_home, #wb_why, #wb_jail, #wb_faq, #wb_test, #wb_contact, #wb_footer, #wb_district, #wb_municipal, #wb_scroller, #wb_headerimage, #wb_navImage, #firstHeading, #content, #bodyContent, 
#pic.hidden, #siteNotice, #wb_main_text, #poll, #wb_bottom_text { display: none !important; } 

/* Ensure the content spans the full width */
#directionsPanel{
    position:absolute;
    top:-120px;
    width:100%;
    left:80px;
    float:none;
    font-size:14px;
    overflow:visible;   
}

/* Cha开发者_Go百科nge text color to black (useful for light text on a dark background) */
.lighttext{
    color: #000000 
}

Here is a link to the page I want to print from. This is just a test site: Google Driving Directions

Enter the start location and then click get directions. Then go to print preview and should see what I'm talking about. Not sure if I have margins set wrong in print view or not try changing them but no avail.


Just add a

page-break-inside: auto;

And it should work. Since I don't know the full DOM, I can't help you more on this one for now. Hope that it helped.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜