 |
| CSS Cascading Style Sheets All issues relating to Cascading Style Sheets (CSS). |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the CSS Cascading Style Sheets section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

March 29th, 2005, 09:30 PM
|
|
Authorized User
|
|
Join Date: Apr 2004
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Overwrite user page setup for printing
Hi,
I would like to set the top, bottom, left, and right margin for my form print out. Therefore, it is not dependent on user page setup option for his/her internet explorer. Is there a CSS method to do this?
Thanks in advance,
Peter
Peter
__________________
Peter
|
|

March 30th, 2005, 06:00 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
You can have two css specifications, one for screen and one for print, like this:
Code:
@media screen {
BODY {margin: 1cm;}
}
@media print {
BODY {margin: 3cm;}
}
--
Joe ( Microsoft MVP - XML)
|
|

March 30th, 2005, 08:29 PM
|
|
Authorized User
|
|
Join Date: Apr 2004
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Joe, thanks for the reply. Your suggestion did not totally resolve my problem because the margin amount is added to the default internet explorer page setup margin. For example, my page setup set all the margins to .75inch for portrait paper; thus, following your suggestion, the first line printed out is 3cm + .75 inch. What I really want is to overwrite the .75inch margin.
Peter
Peter
|
|

March 31st, 2005, 06:32 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
If you mean the settings in the print setup then you cannot change those without an ActiveX control. I have often used ScriptX from meadroid.com. It has a free subset that lets you cahnge a lot of settings but obviously this will only work if the user has IE and allows ActiveX. Otherwise you're stuck with advising them to open the settings box and changing it manually.
--
Joe ( Microsoft MVP - XML)
|
|

March 31st, 2005, 09:24 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
|
|

March 31st, 2005, 02:53 PM
|
|
Authorized User
|
|
Join Date: Apr 2004
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for the reply. I attempted to use the @page rule before but I didn't have any success with it. I will have to educate myself more on this method. If all esle fail, I will attempt the ActiveX control.
Thanks,
peter
Peter
|
|

March 31st, 2005, 05:04 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
I've never had any joy from the @page rule. Even using print templates I had to parse the rule manually.
--
Joe ( Microsoft MVP - XML)
|
|

April 5th, 2007, 10:52 AM
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi, this is the same problem i am currently facing where i need to overwrite the default top margin setup in IE. This issue was posted in 2005 and now in 2007, i hope someone has a solution for this issue.
peter2004,
It would be of greatest help to me, if you may guide me on this.
Thank you very much.
Regards,
Choong
|
|

December 17th, 2007, 05:51 PM
|
|
Registered User
|
|
Join Date: Dec 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi, peter and Choong, did you find a solution for this issue? I am search for a workaround for a while but had no luck. I really hope there is a way to overwrite the default margins without trying active x. Thanks.
|
|
 |