设置元素的盒类型+创建浮动盒

首先说什么是盒子模型,可见元素在页面中会占据一个矩形区域,该区域就是元素的盒子。

  内容和边框都是可见的,内容-内边距-边框,,,,,内边距-边框-外边距,这样有助于记忆。。

display 属性提供了一种改变元素类型的方式,这会改变元素在页面上的布局方式。


块级元素单独占一行,行内元素会和其他元素共占一行。

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8"/>
	<title>display</title>
	<style type="text/css">
	p{
		border: medium double black;
	}
	#kk{
		border: medium double gray;
		background-color: pink;
		display: block;   /*span 设置为块级元素*/
	}
	</style>
</head>

<body>
	<p>
	As the discribing of the fol picture, a man is meeting with an women, the women is soAs the discribing of the fol picture, a man is meeting with an women, the women is soAs the discribing of the fol picture, a man is meeting with an women, the women is soAs the discribing of the fol picture, a man is meeting with an<span id="kk"> women</span>, the women scribing of the fol picture, a man is meeting with an women, the women is soAs the discribing of the fos
	</p>
	<p> is soAs the discribing of the fol picture, a man is meeting with an women, the women is soAs the discribing of the fol picture, a man is meeting with an women, the women is 
	</p>
</body>
</html>



见文知意。

浮动 float

float: left; right none 

定义了浮动的东西会挤在一起,所以需要清除浮动。clear: both;






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值