{"id":766,"date":"2018-02-25T20:40:28","date_gmt":"2018-02-25T12:40:28","guid":{"rendered":"http:\/\/60.205.208.74\/2018\/02\/25\/css-%e5%88%97%e8%a1%a8%e6%a0%b7%e5%bc%8ful\/"},"modified":"2018-02-25T20:40:28","modified_gmt":"2018-02-25T12:40:28","slug":"css-%e5%88%97%e8%a1%a8%e6%a0%b7%e5%bc%8ful","status":"publish","type":"post","link":"https:\/\/www.puzi7.net\/?p=766","title":{"rendered":"CSS \u5217\u8868\u6837\u5f0f(ul)"},"content":{"rendered":"<span itemprop=\"description\"><div class=\"article-body\">\n<div class=\"article-intro\" id=\"content\">\n<h1>CSS <span class=\"color_h1\">\u5217\u8868<\/span><br \/>\n<\/h1>\n<hr>\n<p class=\"intro\">CSS\u5217\u8868\u5c5e\u6027\u4f5c\u7528\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li>\u8bbe\u7f6e\u4e0d\u540c\u7684\u5217\u8868\u9879\u6807\u8bb0\u4e3a\u6709\u5e8f\u5217\u8868<\/li>\n<li>\u8bbe\u7f6e\u4e0d\u540c\u7684\u5217\u8868\u9879\u6807\u8bb0\u4e3a\u65e0\u5e8f\u5217\u8868<\/li>\n<li>\u8bbe\u7f6e\u5217\u8868\u9879\u6807\u8bb0\u4e3a\u56fe\u50cf<\/li>\n<\/ul>\n<p><\/p>\n<hr>\n<h2>\u5217\u8868<\/h2>\n<p>\u5728HTML\u4e2d\uff0c\u6709\u4e24\u79cd\u7c7b\u578b\u7684\u5217\u8868\uff1a<\/p>\n<ul>\n<li>\u65e0\u5e8f\u5217\u8868 &#8211; \u5217\u8868\u9879\u6807\u8bb0\u7528\u7279\u6b8a\u56fe\u5f62\uff08\u5982\u5c0f\u9ed1\u70b9\u3001\u5c0f\u65b9\u6846\u7b49\uff09<\/li>\n<li>\u6709\u5e8f\u5217\u8868 &#8211; \u5217\u8868\u9879\u7684\u6807\u8bb0\u6709\u6570\u5b57\u6216\u5b57\u6bcd<\/li>\n<\/ul>\n<p>\u4f7f\u7528CSS\uff0c\u53ef\u4ee5\u5217\u51fa\u8fdb\u4e00\u6b65\u7684\u6837\u5f0f\uff0c\u5e76\u53ef\u7528\u56fe\u50cf\u4f5c\u5217\u8868\u9879\u6807\u8bb0\u3002<\/p>\n<hr>\n<h2>\u4e0d\u540c\u7684\u5217\u8868\u9879\u6807\u8bb0<\/h2>\n<p>list-style-type\u5c5e\u6027\u6307\u5b9a\u5217\u8868\u9879\u6807\u8bb0\u7684\u7c7b\u578b\u662f\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\">ul<\/span><span class=\"hl-identifier\">.a<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-brackets\">{<\/span><span class=\"hl-reserved\">list-style-type:<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-string\">circle<\/span><span class=\"hl-reserved\"><\/span><span class=\"hl-code\">;<\/span><span class=\"hl-brackets\">}<\/span><span class=\"hl-code\"><br \/>\n<\/span><span class=\"hl-identifier\">ul<\/span><span class=\"hl-identifier\">.b<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-brackets\">{<\/span><span class=\"hl-reserved\">list-style-type:<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-string\">square<\/span><span class=\"hl-reserved\"><\/span><span class=\"hl-code\">;<\/span><span class=\"hl-brackets\">}<\/span><span class=\"hl-code\"><\/p>\n<p><\/span><span class=\"hl-identifier\">ol<\/span><span class=\"hl-identifier\">.c<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-brackets\">{<\/span><span class=\"hl-reserved\">list-style-type:<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-string\">upper-roman<\/span><span class=\"hl-reserved\"><\/span><span class=\"hl-code\">;<\/span><span class=\"hl-brackets\">}<\/span><span class=\"hl-code\"><br \/>\n<\/span><span class=\"hl-identifier\">ol<\/span><span class=\"hl-identifier\">.d<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-brackets\">{<\/span><span class=\"hl-reserved\">list-style-type:<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-string\">lower-alpha<\/span><span class=\"hl-reserved\"><\/span><span class=\"hl-code\">;<\/span><span class=\"hl-brackets\">}<\/span><\/div>\n<\/div>\n<p>\n<\/div>\n<p>\u4e00\u4e9b\u503c\u662f\u65e0\u5e8f\u5217\u8868\uff0c\u4ee5\u53ca\u6709\u4e9b\u662f\u6709\u5e8f\u5217\u8868\u3002<\/p>\n<hr>\n<h2>\u4f5c\u4e3a\u5217\u8868\u9879\u6807\u8bb0\u7684\u56fe\u50cf<\/h2>\n<p>\u8981\u6307\u5b9a\u5217\u8868\u9879\u6807\u8bb0\u7684\u56fe\u50cf\uff0c\u4f7f\u7528\u5217\u8868\u6837\u5f0f\u56fe\u50cf\u5c5e\u6027\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\">ul<\/span><span class=\"hl-code\"><br \/>\n<\/span><span class=\"hl-brackets\">{<\/span><span class=\"hl-code\"><br \/>\n    <\/span><span class=\"hl-reserved\">list-style-image:<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-code\">url<\/span><span class=\"hl-code\">(&#8216;<\/span><span class=\"hl-code\">sqpurple<\/span><span class=\"hl-code\">.<\/span><span class=\"hl-code\">gif<\/span><span class=\"hl-code\">&#8216;)<\/span><span class=\"hl-reserved\"><\/span><span class=\"hl-code\">;<br \/>\n<\/span><span class=\"hl-brackets\">}<\/span><\/div>\n<\/div>\n<p>\n<\/div>\n<p>\u4e0a\u9762\u7684\u4f8b\u5b50\u5728\u6240\u6709\u6d4f\u89c8\u5668\u4e2d\u663e\u793a\u5e76\u4e0d\u76f8\u540c\uff0cIE\u548cOpera\u663e\u793a\u56fe\u50cf\u6807\u8bb0\u6bd4\u706b\u72d0\uff0cChrome\u548cSafari\u66f4\u9ad8\u4e00\u70b9\u70b9\u3002<\/p>\n<p>\u5982\u679c\u4f60\u60f3\u5728\u6240\u6709\u7684\u6d4f\u89c8\u5668\u653e\u7f6e\u540c\u6837\u7684\u5f62\u8c61\u6807\u5fd7\uff0c\u5c31\u5e94\u4f7f\u7528\u6d4f\u89c8\u5668\u517c\u5bb9\u6027\u89e3\u51b3\u65b9\u6848\uff0c\u8fc7\u7a0b\u5982\u4e0b<\/p>\n<h2>\u6d4f\u89c8\u5668\u517c\u5bb9\u6027\u89e3\u51b3\u65b9\u6848<\/h2>\n<p>\u540c\u6837\u5728\u6240\u6709\u7684\u6d4f\u89c8\u5668\uff0c\u4e0b\u9762\u7684\u4f8b\u5b50\u4f1a\u663e\u793a\u7684\u56fe\u50cf\u6807\u8bb0\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\">ul<\/span><span class=\"hl-code\"><br \/>\n<\/span><span class=\"hl-brackets\">{<\/span><span class=\"hl-code\"><br \/>\n    <\/span><span class=\"hl-reserved\">list-style-type:<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-string\">none<\/span><span class=\"hl-reserved\"><\/span><span class=\"hl-code\">;<br \/>\n    <\/span><span class=\"hl-reserved\">padding:<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-number\">0<\/span><span class=\"hl-string\">px<\/span><span class=\"hl-reserved\"><\/span><span class=\"hl-code\">;<br \/>\n    <\/span><span class=\"hl-reserved\">margin:<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-number\">0<\/span><span class=\"hl-string\">px<\/span><span class=\"hl-reserved\"><\/span><span class=\"hl-code\">;<br \/>\n<\/span><span class=\"hl-brackets\">}<\/span><span class=\"hl-code\"><br \/>\n<\/span><span class=\"hl-identifier\">ul<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-identifier\">li<\/span><span class=\"hl-code\"><br \/>\n<\/span><span class=\"hl-brackets\">{<\/span><span class=\"hl-code\"><br \/>\n    <\/span><span class=\"hl-reserved\">background-image:<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-code\">url<\/span><span class=\"hl-code\">(<\/span><span class=\"hl-code\">sqpurple<\/span><span class=\"hl-code\">.<\/span><span class=\"hl-code\">gif<\/span><span class=\"hl-code\">)<\/span><span class=\"hl-reserved\"><\/span><span class=\"hl-code\">;<br \/>\n    <\/span><span class=\"hl-reserved\">background-repeat:<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-string\">no-repeat<\/span><span class=\"hl-reserved\"><\/span><span class=\"hl-code\">;<br \/>\n    <\/span><span class=\"hl-reserved\">background-position:<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-number\">0<\/span><span class=\"hl-string\">px<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-number\">5<\/span><span class=\"hl-string\">px<\/span><span class=\"hl-reserved\"><\/span><span class=\"hl-code\">;<br \/>\n    <\/span><span class=\"hl-reserved\">padding-left:<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-number\">14<\/span><span class=\"hl-string\">px<\/span><span class=\"hl-reserved\"><\/span><span class=\"hl-code\">;<br \/>\n<\/span><span class=\"hl-brackets\">}<\/span><\/div>\n<\/div>\n<p>\n<\/div>\n<p>\u4f8b\u5b50\u89e3\u91ca\uff1a<\/p>\n<ul>\n<li>ul:\n<ul>\n<li>\u8bbe\u7f6e\u5217\u8868\u6837\u5f0f\u7c7b\u578b\u4e3a\u6ca1\u6709\u5220\u9664\u5217\u8868\u9879\u6807\u8bb0\n<\/li>\n<li>\u8bbe\u7f6e\u586b\u5145\u548c\u8fb9\u8ddd0px\uff08\u6d4f\u89c8\u5668\u517c\u5bb9\u6027\uff09<\/li>\n<\/ul>\n<\/li>\n<li>ul\u4e2d\u6240\u6709li:\n<ul>\n<li>\u8bbe\u7f6e\u56fe\u50cf\u7684URL\uff0c\u5e76\u8bbe\u7f6e\u5b83\u53ea\u663e\u793a\u4e00\u6b21\uff08\u65e0\u91cd\u590d\uff09\n<\/li>\n<li>\u60a8\u9700\u8981\u7684\u5b9a\u4f4d\u56fe\u50cf\u4f4d\u7f6e\uff08\u5de60px\u548c\u4e0a\u4e0b5px\uff09<\/li>\n<li>\u7528padding-left\u5c5e\u6027\u628a\u6587\u672c\u7f6e\u4e8e\u5217\u8868\u4e2d<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr>\n<h2>\u5217\u8868 -\u7b80\u5199\u5c5e\u6027<\/h2>\n<p>\u5728\u5355\u4e2a\u5c5e\u6027\u4e2d\u53ef\u4ee5\u6307\u5b9a\u6240\u6709\u7684\u5217\u8868\u5c5e\u6027\u3002\u8fd9\u5c31\u662f\u6240\u8c13\u7684\u7b80\u5199\u5c5e\u6027\u3002<\/p>\n<p>\u4e3a\u5217\u8868\u4f7f\u7528\u7b80\u5199\u5c5e\u6027\uff0c\u5217\u8868\u6837\u5f0f\u5c5e\u6027\u8bbe\u7f6e\u5982\u4e0b\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\">ul<\/span><span class=\"hl-code\"><br \/>\n<\/span><span class=\"hl-brackets\">{<\/span><span class=\"hl-code\"><br \/>\n    <\/span><span class=\"hl-reserved\">list-style:<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-string\">square<\/span><span class=\"hl-code\"> <\/span><span class=\"hl-code\">url<\/span><span class=\"hl-code\">(&#8220;<\/span><span class=\"hl-code\">sqpurple<\/span><span class=\"hl-code\">.<\/span><span class=\"hl-code\">gif<\/span><span class=\"hl-code\">&#8220;)<\/span><span class=\"hl-reserved\"><\/span><span class=\"hl-code\">;<br \/>\n<\/span><span class=\"hl-brackets\">}<\/span><\/div>\n<\/div>\n<p>\n<\/div>\n<p>\u53ef\u4ee5\u6309\u987a\u5e8f\u8bbe\u7f6e\u5982\u4e0b\u5c5e\u6027\uff1a\n<\/p>\n<ul>\n<li>list-style-type<\/li>\n<li>list-style-position (\u6709\u5173\u8bf4\u660e\uff0c\u8bf7\u53c2\u89c1\u4e0b\u9762\u7684CSS\u5c5e\u6027\u8868)<\/li>\n<li>list-style-image<\/li>\n<\/ul>\n<p>\u5982\u679c\u4e0a\u8ff0\u503c\u4e22\u5931\u4e00\u4e2a\uff0c\u5176\u4f59\u4ecd\u5728\u6307\u5b9a\u7684\u987a\u5e8f\uff0c\u5c31\u6ca1\u5173\u7cfb\u3002<\/p>\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\u6240\u6709\u4e0d\u540c\u7684CSS\u5217\u8868\u9879\u6807\u8bb0\u3002<\/p>\n<hr>\n<h2>\u6240\u6709\u7684CSS\u5217\u8868\u5c5e\u6027<\/h2>\n<table class=\"reference\">\n<tr>\n<th width=\"20%\" align=\"left\">\u5c5e\u6027<\/th>\n<th width=\"80%\" align=\"left\">\u63cf\u8ff0<\/th>\n<\/tr>\n<tr>\n<td><a href=\"\/cssref\/pr-list-style.html\">list-style<\/a><\/td>\n<td>\u7b80\u5199\u5c5e\u6027\u3002\u7528\u4e8e\u628a\u6240\u6709\u7528\u4e8e\u5217\u8868\u7684\u5c5e\u6027\u8bbe\u7f6e\u4e8e\u4e00\u4e2a\u58f0\u660e\u4e2d<\/td>\n<\/tr>\n<tr>\n<td><a href=\"\/cssref\/pr-list-style-image.html\">list-style-image<\/a><\/td>\n<td>\u5c06\u56fe\u8c61\u8bbe\u7f6e\u4e3a\u5217\u8868\u9879\u6807\u5fd7\u3002<\/td>\n<\/tr>\n<tr>\n<td><a href=\"\/cssref\/pr-list-style-position.html\">list-style-position<\/a><\/td>\n<td>\u8bbe\u7f6e\u5217\u8868\u4e2d\u5217\u8868\u9879\u6807\u5fd7\u7684\u4f4d\u7f6e\u3002<\/td>\n<\/tr>\n<tr>\n<td><a href=\"\/cssref\/pr-list-style-type.html\">list-style-type<\/a><\/td>\n<td>\u8bbe\u7f6e\u5217\u8868\u9879\u6807\u5fd7\u7684\u7c7b\u578b\u3002<\/td>\n<\/tr>\n<\/table><\/div>\n<\/p><\/div>\n<span>","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\"><span itemprop=\"description\">CSS \u5217\u8868 CSS\u5217\u8868\u5c5e\u6027\u4f5c\u7528\u5982\u4e0b\uff1a \u8bbe\u7f6e\u4e0d\u540c\u7684\u5217\u8868\u9879\u6807\u8bb0\u4e3a\u6709\u5e8f\u5217\u8868 \u8bbe\u7f6e\u4e0d\u540c\u7684\u5217\u8868\u9879\u6807&hellip;<\/span><\/p>\n<p class=\"more-link-p btn-align-right\"><a class=\"green zoom-btn\" href=\"https:\/\/www.puzi7.net\/?p=766\">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-766","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\/766","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=766"}],"version-history":[{"count":0,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=\/wp\/v2\/posts\/766\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.puzi7.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}