In general, you need to be careful when using margins because they are the outermost layer of a page. If you set the margins of a body element to three inches on either side, for example, be sure to set the width of that same body element as well, or your page will look like that shown.
However, in theory, you should be able to set margins for the printed page without worrying about the body text running off to one side of the browser when you neglect to set the width of the page’s other elements.
This is because margins can be set using the margin property in CSS within an @page rule. Margins were covered in Chapter 20, Padding, Margins, and Borders. You can set the page margins, by simply using the margin property in the same manner as you use it anywhere else, as shown here:
@page { size: 3in 3in;margin: .5in; page-break-after: left; {Bad margins
The margin settings should be ignored when being viewed on the Web when they’re set in an @page rule. However, once again, at the time of this writing, browser support for this feature is weak.
|
|
HTML Related Tutorials |
|
---|---|
XML Tutorial | HTML 4 Tutorial |
HTML 5 Tutorial | Java Tutorial |
CSS Tutorial | XHTML Tutorial |
HTML Related Interview Questions |
|
---|---|
XML Interview Questions | HTML 4 Interview Questions |
HTML Interview Questions | HTML 5 Interview Questions |
HTML+XHTML Interview Questions | HTML+Javascript Interview Questions |
HTML DOM Interview Questions | Java Interview Questions |
CSS Interview Questions | Java Abstraction Interview Questions |
Dynamic HTML Interview Questions | XHTML Interview Questions |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.