Listbox owerflow when printing from IE

When I print a list page from IE, the contents of owerflows. This only happens in IE, and this is only the actual print, print preview looks good.

Here is a sample code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title></title></head> <body> <form name="form1" method="post" action="/IePrintTest.aspx" id="form1"> <select size="4" name="Listbox" id="Listbox"> <option value="item1">item1</option> <option value="item2">item2</option> <option value="item3">item3</option> <option value="item4">item4</option> <option value="item5">item5</option> <option value="item6">item6</option> <option value="item7">item7</option> <option value="item8">item8</option> <option value="item9">item9</option> <option value="item10">item10</option> <option value="item11">item11</option> <option value="item12">item12</option> <option value="item13">item13</option> <option value="item14">item14</option> <option value="item15">item15</option> <option value="item16">item16</option> <option value="item17">item17</option> </select> </form> </body> </html> 

This is just fine, but if I try to print this from IE, it will look like this:

Print Image

Does anyone know how to fix this. Thanks!

+6
source share
2 answers

It appears that when printing from IE and the size attribute to select browser sets a fixed height and does not apply overflow. I have no way to test IE since I use Ubuntu, but can you try adding style="overflow: hidden;" to the select element? If it doesn't work and removing the size attribute is an option, try also.

+2
source

How is the use case used for this web page? If everything is in order for the user to click the button first to open the print page, you could serve the quirks version of the content to make servercript conditionally add DOCTYPE.

+1
source

Source: https://habr.com/ru/post/903709/


All Articles