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

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

          css怎么設(shè)置外邊距

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

          css怎么設(shè)置外邊距

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

          1、使用margin屬性

          margin簡(jiǎn)寫屬性在一個(gè)聲明中設(shè)置所有外邊距屬性。該屬性可以有1到4個(gè)值。

          實(shí)例:

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

          • 右邊距是 5px

          • 下邊距是 15px

          • 左邊距是 20px

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

          • 右邊距和左邊距是 5px

          • 下邊距是 15px

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

          • 右邊距和左邊距是 5px

          margin:10px;
          • 所有四個(gè)邊距都是 10px

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

          • margin-top:設(shè)置元素的上外邊距

          • margin-bottom:設(shè)置元素的下外邊距

          • margin-left:設(shè)置元素的左外邊距

          • margin-right:設(shè)置元素的右外邊距

          示例:

          <!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>測(cè)試文本</div> 		<div class="a1">測(cè)試文本</div> 		<div class="a2">測(cè)試文本</div> 		<div class="a3">測(cè)試文本</div> 		<div class="a4">測(cè)試文本</div> 		<div>測(cè)試文本</div> 	</body>  </html>

          效果圖:

          css怎么設(shè)置外邊距

          (學(xué)習(xí)視頻分享:css視頻教程)

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