在css文字边距上怎么通过css的属性来设置?

html-css013

在css文字边距上怎么通过css的属性来设置?,第1张

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>文字上边距</title>

<style>

*{

margin:0

padding:0

}

</style>

<body>

<div style="width:200pxheight:200pxpadding-top:20pxborder:1px solid red">

文字内容,padding:20px上边距20px。border:1px solid red1px的红色边框。width:200pxheight:200px宽度和高度200px。

</div>

</body>

</html>

外边距margin

上外边距margin-top

右外边距margin-right

下外边距margin-bottom

左外边距margin-left

内边距padding

上内边距padding-top

右内边距padding-right

下内边距padding-bottom

左内边距padding-left

#容器ID{

margin-left:100px左边距100像素

margin-right:100px右边距100像素

margin-top:100px上边距100像素

margin-bottom:100px下边距100像素

明白了吗~~~~~~才15分~~~~!