欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          css怎么設置外邊距

          css設置外邊距的方法:1、使用margin屬性,在一個聲明中設置元素的所有外邊距;2、使用margin-top、margin-bottom、margin-left和margin-right屬性,分別設置元素的上、下、左、右四個外邊距。

          css怎么設置外邊距

          本教程操作環(huán)境:windows7系統(tǒng)、CSS3&&HTML5版、Dell G3電腦。

          1、使用margin屬性

          margin簡寫屬性在一個聲明中設置所有外邊距屬性。該屬性可以有1到4個值。

          實例:

          margin:10px 5px 15px 20px;
          • 上邊距是 10px

          • 右邊距是 5px

          • 下邊距是 15px

          • 左邊距是 20px

          margin:10px 5px 15px;
          • 上邊距是 10px

          • 右邊距和左邊距是 5px

          • 下邊距是 15px

          margin:10px 5px;
          • 上邊距和下邊距是 10px

          • 右邊距和左邊距是 5px

          margin:10px;
          • 所有四個邊距都是 10px

          2、使用margin-top、margin-bottom、margin-left和margin-right屬性

          • margin-top:設置元素的上外邊距

          • margin-bottom:設置元素的下外邊距

          • margin-left:設置元素的左外邊距

          • margin-right:設置元素的右外邊距

          示例:

          <!DOCTYPE html> <html>  	<head> 		<meta charset="utf-8" /> 		<style> 			div{ 				border: 1px solid red; 			} 			.a1{ 				margin-top: 10px; 			} 			.a2{ 				margin-bottom: 10px; 			} 			.a3{ 				margin-left: 10px; 			} 			.a4{ 				margin-right: 10px; 			} 		</style> 	</head>  	<body> 		<div>測試文本</div> 		<div class="a1">測試文本</div> 		<div class="a2">測試文本</div> 		<div class="a3">測試文本</div> 		<div class="a4">測試文本</div> 		<div>測試文本</div> 	</body>  </html>

          效果圖:

          css怎么設置外邊距

          (學習視頻分享:css視頻教程)

          贊(0)
          分享到: 更多 (0)
          網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號