Which attributes of <BODY> tags are used to set margins in a web page?
Answers
Answered by
0
Answer:
I’m prognosticating that you’re comfortable writing HTML, but not familiar with CSS. So you can do it this way:
<body style=”margin: 10px;”>
</body>
Explanation:
Where I wrote “10px” (which stands for 10 pixels) you can write “5px” or “20px” or any number of pixels. You can also write “10%” (or “20%” or “5%” or whatever) and the margins will be 10 percent of the body tag’s width. Or you can say “5em” (or “10em” etc. etc.) and the margin will be as wide as five letter M’s.
Of course, the closing body tag “</body>” will go toward the bottom of your document. I’m sure you already know that.
All this being said, this is not the ideal way to do it. The best practice would be to create a separate style sheet and link it to your HTML.
Similar questions