Home > Web Front-end > Front-end Q&A > How to set the overall page margins in html

How to set the overall page margins in html

青灯夜游
Release: 2023-01-03 09:31:05
Original
11811 people have browsed it

In html, you can set the overall page margin by adding margins using the margin attribute in the body tag element. The specific syntax format is "body{margin: margin value;}". The body tag contains all the content of the document and represents the entire html page.

How to set the overall page margins in html

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

Set html overall page margins

<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<style>
			body{margin: 30px;}
		</style>
	</head>

	<body>
		HTML页面主体内容
	</body>

</html>
Copy after login

Rendering:

How to set the overall page margins in html

Instructions :

tag defines the body of the document. The

element contains all the content of the document (such as text, hyperlinks, images, tables, lists, etc.). [Recommended tutorial: "html video tutorial"]

margin is a shorthand attribute that can set all margin attributes in one statement. This attribute can have 1 to 4 values. [Recommended tutorial: CSS video tutorial]

How to set the overall page margins in html

For more programming-related knowledge, please visit: Programming Video! !

The above is the detailed content of How to set the overall page margins in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template