{"id":771,"date":"2018-02-25T20:40:31","date_gmt":"2018-02-25T12:40:31","guid":{"rendered":"http:\/\/60.205.208.74\/2018\/02\/25\/css-margin%e5%a4%96%e8%be%b9%e8%b7%9d\/"},"modified":"2018-02-25T20:40:31","modified_gmt":"2018-02-25T12:40:31","slug":"css-margin%e5%a4%96%e8%be%b9%e8%b7%9d","status":"publish","type":"post","link":"https:\/\/www.puzi7.net\/?p=771","title":{"rendered":"CSS Margin(\u5916\u8fb9\u8ddd)"},"content":{"rendered":"<span itemprop=\"description\"><div class=\"article-body\">\n<div class=\"article-intro\" id=\"content\">\n<h1>CSS <span class=\"color_h1\">Margin(\u5916\u8fb9\u8ddd)<\/span><br \/>\n<\/h1>\n<hr>\n<p class=\"intro\">CSS Margin(\u5916\u8fb9\u8ddd)\u5c5e\u6027\u5b9a\u4e49\u5143\u7d20\u5468\u56f4\u7684\u7a7a\u95f4\u3002<\/p>\n<hr>\n<h2>Margin<\/h2>\n<p>margin\u6e05\u9664\u5468\u56f4\u7684\u5143\u7d20\uff08\u5916\u8fb9\u6846\uff09\u7684\u533a\u57df\u3002margin\u6ca1\u6709\u80cc\u666f\u989c\u8272\uff0c\u662f\u5b8c\u5168\u900f\u660e\u7684<\/p>\n<p>margin\u53ef\u4ee5\u5355\u72ec\u6539\u53d8\u5143\u7d20\u7684\u4e0a\uff0c\u4e0b\uff0c\u5de6\uff0c\u53f3\u8fb9\u8ddd\u3002\u4e5f\u53ef\u4ee5\u4e00\u6b21\u6539\u53d8\u6240\u6709\u7684\u5c5e\u6027\u3002<\/p>\n<h2>\u53ef\u80fd\u7684\u503c<\/h2>\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"1\" class=\"reference\">\n<tbody>\n<tr>\n<th align=\"left\">\u503c<\/th>\n<th align=\"left\">\u8bf4\u660e<\/th>\n<\/tr>\n<tr>\n<td>auto<\/td>\n<td>\u8bbe\u7f6e\u6d4f\u89c8\u5668\u8fb9\u8ddd\u3002<br \/>\u8fd9\u6837\u505a\u7684\u7ed3\u679c\u4f1a\u4f9d\u8d56\u4e8e\u6d4f\u89c8\u5668<\/td>\n<\/tr>\n<tr>\n<td><i>length<\/i><\/td>\n<td>\u5b9a\u4e49\u4e00\u4e2a\u56fa\u5b9a\u7684margin\uff08\u4f7f\u7528\u50cf\u7d20\uff0cpt\uff0cem\u7b49\uff09 <\/td>\n<\/tr>\n<tr>\n<td><i>%<\/i><\/td>\n<td>\u5b9a\u4e49\u4e00\u4e2a\u4f7f\u7528\u767e\u5206\u6bd4\u7684\u8fb9\u8ddd<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img decoding=\"async\" src=\"\/images\/lamp.gif\" alt=\"Remark\"> Margin\u53ef\u4ee5\u4f7f\u7528\u8d1f\u503c\uff0c\u91cd\u53e0\u7684\u5185\u5bb9\u3002<\/p>\n<hr>\n<h2>Margin &#8211; \u5355\u8fb9\u5916\u8fb9\u8ddd\u5c5e\u6027<\/h2>\n<p>\u5728CSS\u4e2d\uff0c\u5b83\u53ef\u4ee5\u6307\u5b9a\u4e0d\u540c\u7684\u4fa7\u9762\u4e0d\u540c\u7684\u8fb9\u8ddd\uff1a<\/p>\n<div class=\"example\">\n<h2 class=\"example\">\u5b9e\u4f8b<\/h2>\n<div class=\"example_code\">\n<div class=\"hl-main\"><span class=\"hl-identifier\">margin-top<\/span><span class=\"hl-code\">:100<\/span><span class=\"hl-identifier\">px<\/span><span class=\"hl-code\">;<br \/>\n<\/span><span class=\"hl-identifier\">margin-bottom<\/span><span class=\"hl-code\">:100<\/span><span class=\"hl-identifier\">px<\/span><span class=\"hl-code\">;<br \/>\n<\/span><span class=\"hl-identifier\">margin-right<\/span><span class=\"hl-code\">:50<\/span><span class=\"hl-identifier\">px<\/span><span class=\"hl-code\">;<br \/>\n<\/span><span class=\"hl-identifier\">margin-left<\/span><span class=\"hl-code\">:50<\/span><span class=\"hl-identifier\">px<\/span><span class=\"hl-code\">;<\/span><\/div>\n<\/div>\n<p>\n<\/div>\n<p><\/p>\n<hr>\n<h2>Margin &#8211; \u7b80\u5199\u5c5e\u6027<\/h2>\n<p>\u4e3a\u4e86\u7f29\u77ed\u4ee3\u7801\uff0c\u6709\u53ef\u80fd\u4f7f\u7528\u4e00\u4e2a\u5c5e\u6027\u4e2dmargin\u6307\u5b9a\u7684\u6240\u6709\u8fb9\u8ddd\u5c5e\u6027\u3002\u8fd9\u5c31\u662f\u6240\u8c13\u7684\u7f29\u5199\u5c5e\u6027\u3002<\/p>\n<p>\u6240\u6709\u8fb9\u8ddd\u5c5e\u6027\u7684\u7f29\u5199\u5c5e\u6027\u662f&#8221;margin&#8221;:<\/p>\n<div class=\"example\">\n<h2 class=\"example\">\u5b9e\u4f8b<\/h2>\n<div class=\"example_code\">\n<div class=\"hl-main\"><span class=\"hl-identifier\">margin<\/span><span class=\"hl-code\">:100<\/span><span class=\"hl-identifier\">px<\/span><span class=\"hl-code\"> 50<\/span><span class=\"hl-identifier\">px<\/span><span class=\"hl-code\">;<\/span><\/div>\n<\/div>\n<p>\n<\/div>\n<p>margin\u5c5e\u6027\u53ef\u4ee5\u6709\u4e00\u5230\u56db\u4e2a\u503c\u3002\/p&gt;\n<\/p>\n<ul>\n<li>\n<b>margin:25px 50px 75px 100px; <\/b><\/p>\n<ul>\n<li>\u4e0a\u8fb9\u8ddd\u4e3a25px<\/li>\n<li>\u53f3\u8fb9\u8ddd\u4e3a50px<\/li>\n<li>\u4e0b\u8fb9\u8ddd\u4e3a75px<\/li>\n<li>\u5de6\u8fb9\u8ddd\u4e3a100px<\/li>\n<\/ul>\n<p>\n<\/li>\n<li>\n<b>margin:25px 50px 75px;<\/b><\/p>\n<ul>\n<li>\u4e0a\u8fb9\u8ddd\u4e3a25px<\/li>\n<li>\u5de6\u53f3\u8fb9\u8ddd\u4e3a50px<\/li>\n<li>\u4e0b\u8fb9\u8ddd\u4e3a75px<\/li>\n<\/ul>\n<p>\n<\/li>\n<li>\n<b>margin:25px 50px;<\/b><\/p>\n<ul>\n<li>\u4e0a\u4e0b\u8fb9\u8ddd\u4e3a25px<\/li>\n<li>\u5de6\u53f3\u8fb9\u8ddd\u4e3a50px<\/li>\n<\/ul>\n<p>\n<\/li>\n<li>\n<b>margin:25px;<\/b><\/p>\n<ul>\n<li>\u6240\u6709\u76844\u4e2a\u8fb9\u8ddd\u90fd\u662f25px<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr>\n<div class=\"tryit_ex\">\n<img decoding=\"async\" src=\"\/images\/tryitimg.gif\" width=\"40\" height=\"46px\" alt=\"Examples\"><\/p>\n<h2>\u66f4\u591a\u5b9e\u4f8b<\/h2>\n<\/div>\n<p>\n\u8fd9\u4e2a\u4f8b\u5b50\u6f14\u793a\u4e86\u5982\u4f55\u8bbe\u7f6e\u4e00\u4e2a\u4f7f\u7528\u5398\u7c73\u503c\u7684\u6587\u672c\u7684\u9876\u90e8margin\u3002<\/p>\n<p>\n\u8fd9\u4e2a\u4f8b\u5b50\u6f14\u793a\u4e86\u5982\u4f55\u8bbe\u7f6e\u4f7f\u7528\u767e\u5206\u6bd4\u503c\u7684\u4e0b\u8fb9\u8ddd\uff0c\u76f8\u5bf9\u4e8e\u5305\u542b\u7684\u5143\u7d20\u7684\u5bbd\u5ea6\u3002<\/p>\n<hr>\n<h2>\u6240\u6709\u7684CSS\u8fb9\u8ddd\u5c5e\u6027<\/h2>\n<table class=\"reference\">\n<tbody>\n<tr>\n<th>\u5c5e\u6027<\/th>\n<th>\u63cf\u8ff0<\/th>\n<\/tr>\n<tr>\n<td><a href=\"\/cssref\/pr-margin.html\" title=\"CSS margin \u5c5e\u6027\">margin<\/a><\/td>\n<td>\u7b80\u5199\u5c5e\u6027\u3002\u5728\u4e00\u4e2a\u58f0\u660e\u4e2d\u8bbe\u7f6e\u6240\u6709\u5916\u8fb9\u8ddd\u5c5e\u6027\u3002<\/td>\n<\/tr>\n<tr>\n<td><a href=\"\/cssref\/pr-margin-bottom.html\" title=\"CSS margin-bottom \u5c5e\u6027\">margin-bottom<\/a><\/td>\n<td>\u8bbe\u7f6e\u5143\u7d20\u7684\u4e0b\u5916\u8fb9\u8ddd\u3002<\/td>\n<\/tr>\n<tr>\n<td><a href=\"\/cssref\/pr-margin-left.html\" title=\"CSS margin-left \u5c5e\u6027\">margin-left<\/a><\/td>\n<td>\u8bbe\u7f6e\u5143\u7d20\u7684\u5de6\u5916\u8fb9\u8ddd\u3002<\/td>\n<\/tr>\n<tr>\n<td><a href=\"\/cssref\/pr-margin-right.html\" title=\"CSS margin-right \u5c5e\u6027\">margin-right<\/a><\/td>\n<td>\u8bbe\u7f6e\u5143\u7d20\u7684\u53f3\u5916\u8fb9\u8ddd\u3002<\/td>\n<\/tr>\n<tr>\n<td><a href=\"\/cssref\/pr-margin-top.html\" title=\"CSS margin-top \u5c5e\u6027\">margin-top<\/a><\/td>\n<td>\u8bbe\u7f6e\u5143\u7d20\u7684\u4e0a\u5916\u8fb9\u8ddd\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<\/p><\/div>\n<span>","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\"><span itemprop=\"description\">CSS Margin(\u5916\u8fb9\u8ddd) CSS Margin(\u5916\u8fb9\u8ddd)\u5c5e\u6027\u5b9a\u4e49\u5143\u7d20\u5468\u56f4\u7684\u7a7a\u95f4\u3002 M&hellip;<\/span><\/p>\n<p class=\"more-link-p btn-align-right\"><a class=\"green zoom-btn\" href=\"https:\/\/www.puzi7.net\/?p=771\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35,29,7],"tags":[53],"class_list":["post-771","post","type-post","status-publish","format-standard","hentry","category-css","category-frontend","category-basic","tag-css","zoom-theme-has-thumb"],"_links":{"self":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts\/771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=771"}],"version-history":[{"count":0,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts\/771\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}