CSS内外间距

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.c1{
width: 200px;
height: 200px;

border: 10px solid red;
/*padding(内间距)/margin(外间距):top bottom left right*/
padding: 50px 50px 50px 50px;
margin-bottom: 20px;
}
.c2{
width: 200px;
height: 200px;

display: inline-block;

}

.c3{
width: 200px;
height: 200px;
background-color: yellow;
display: inline-block;
margin: -5px;
}

</style>
</head>
<body>

<div class="c1">huchangxi</div>
<div class="c2"></div>
<div class="c3"></div>

</body>
</html>

 

posted @   呼长喜  阅读(70)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
点击右上角即可分享
微信分享提示