Home  >  Article  >  Web Front-end  >  HTML5 attributes: Usage examples of margin attribute

HTML5 attributes: Usage examples of margin attribute

不言
不言Original
2018-08-09 15:04:555816browse

This article introduces to you about HTML5 attributes: usage examples of margin attributes. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
p{
width: 100px;
height: 100px;
background-color: red;
/* 外边距 */
margin-top: 30px;
margin-left: 100px;
margin-right: 100px;
margin-bottom: 100px;
/* 连写 */
margin: 40px;
margin: 0 auto;
/* 内边距 pandding */
padding: 30px;
}
</style>
</head>
<body>
<p>p第一个</p>
<p>p第二个</p>
</body>
</html>

The operation effect is as follows:

HTML5 attributes: Usage examples of margin attribute

Related recommendations:

HTML5 attributes: Usage examples of form form attributes

Example code of div tag in HTML5

The above is the detailed content of HTML5 attributes: Usage examples of margin attribute. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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