I want to change the default margins of Browser through JavaScript because I want to print the displayed document on page but the margins are different on different browser??? plz help me to change default margins of browser. if you have any solution tell me.
views:
71answers:
4
A:
use jquery
$(document).ready(function() {
$("body").css("margin","0");
});
Using CSS
body { margin:0; }
Starx
2010-06-09 05:31:19
A:
CSS:
body, html { margin:0 }
or
* { margin:0 }
or look into CSS reset. Would recommend this over JavaScript.
Louis
2010-06-09 05:36:22
+3
A:
Not javascript, but if you are looking for specific styles to use for printing you can use:
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
where print.css
would contain something like
* { margin:0 }
zipcodeman
2010-06-09 05:38:30
+2
A:
I would recommend adding reset.css to your page, and probably to all of your pages/projects.
This way you should be able to eliminate all differencies in default style values amongst browsers.
EDIT: check out one of the most valuable threads at StackOverflow.com
Jaroslav Záruba
2010-06-09 05:45:23
superb dear thank you
Govind KamalaPrakash Malviya
2010-06-09 06:24:48
you're welcome... yeah i have that from Stackoverflow :) see edit
Jaroslav Záruba
2010-06-09 06:27:57