{"id":529,"date":"2010-10-07T12:02:38","date_gmt":"2010-10-07T12:02:38","guid":{"rendered":""},"modified":"2010-10-07T12:02:38","modified_gmt":"2010-10-07T12:02:38","slug":"529","status":"publish","type":"post","link":"https:\/\/www.poloo.org\/?p=529","title":{"rendered":"\u600e\u6837\u4f7f\u7528css\u5236\u4f5c\u8ff7\u4eba\u7684button"},"content":{"rendered":"<p>\u8fd9\u662f\u4e00\u4e2a\u6559\u7a0b\uff0c\u4f5c\u8005Alex\u4e00\u6b65\u6b65\u5730\u53eb\u6211\u4eec\u600e\u6837\u4f7f\u7528css\u6765\u5236\u4f5c\u4e00\u4e2a\u8ff7\u4eba\u7684\u6309\u94ae\uff0c\u770b\u540e\u89c9\u5f97\u633a\u597d\uff0c\u5f88\u60f3\u5927\u5bb6\u90fd\u770b\u770b\uff0c\u7ffb\u8bd1\u7684\u53ef\u80fd\u7a0d\u6709\u4e0d\u59a5\uff0c\u671b\u8c05\u89e3\u2026\u2026<br \/>&nbsp;&nbsp;\u8fd9\u4e2a\u6559\u7a0b\u5c06\u8981\u6559\u4f1a\u4f60\u4f7f\u7528css\u6765\u5236\u4f5c\u975e\u5e38\u597d\u770b\u7684\u6309\u94ae\uff08\u5305\u62ec\u4e0d\u540c\u7684\u70b9\u51fb\u72b6\u6001\uff09\u3002\u52a8\u6001\u7684\u6309\u94ae\u8282\u7701\u4e86\u60a8\u5927\u91cf\u7684\u82b1\u5728\u753b\u56fe\u7684\u65f6\u95f4\u3002<br \/>&nbsp;&nbsp;\u5176\u5b9e\u4f60\u4e5f\u53ef\u4ee5\u5236\u4f5c\u51fa\u6765\u8fd9\u6837\u6f02\u4eae\u7684\u6309\u94ae\u7684\uff0c\u53ea\u9700\u8981\u8ddf\u7740\u6211\u4eec\u7684\u6559\u7a0b\u5c31\u53ef\u4ee5\u4e86\uff1a<br \/><strong>\u7b2c\u4e00\u6b65\uff1a\u6ed1\u52a8\u95e8<\/strong><br \/>&nbsp;&nbsp;\u6211\u4eec\u60f3\u4f7f\u6309\u94ae\u53ef\u4ee5\u7075\u6d3b\u6269\u5c55\uff0c\u6240\u4ee5\u6211\u4eec\u5fc5\u987b\u5f97\u8ba9\u80cc\u666f\u56fe\u7247\u968f\u7740\u6309\u94ae\u4e0a\u9762\u7684\u6587\u5b57\u7684\u6269\u5c55\u800c\u6269\u5c55\uff0c\u6240\u4ee5\uff0c\u6211\u4eec\u5c31\u5fc5\u987b\u8981\u4f7f\u7528\u5230\u53ef\u7231\u7684\u6ed1\u52a8\u95e8\u6280\u672f\uff1a\u4e24\u5f20\u56fe\u7247\u5408\u4f5c\u7ed9\u4eba\u4e00\u79cd\u53ef\u4ee5\u6269\u5c55\u7684\u5355\u5f20\u56fe\u7247\u7684\u5047\u8c61\uff1a\u3000<br \/>&nbsp;&nbsp;\u6211\u4eec\u7684\u6309\u94ae\u662f\u4e00\u4e2a&lt;a&gt;\u6807\u7b7e\u5185\u5d4c\u4e00\u4e2a&lt;span&gt;\u6807\u7b7e\u7ec4\u6210\uff0ca\u6807\u7b7e\u548cspan\u6807\u7b7e\u5404\u81ea\u542b\u6709\u4e00\u5f20\u4e0d\u540c\u7684\u80cc\u666f\u56fe\u7247\uff0c\u6211\u4eec\u7684html\u4ee3\u7801\u5982\u4e0b:<br \/><code><br \/>&lt;a class=\"button\" href=\"#\"&gt;&lt;span&gt;Bring world peace&lt;\/span&gt;&lt;\/a&gt;&nbsp;&nbsp;<br \/><\/code><\/p>\n<p>\u597d\u50cf\u770b\u4f3c\u6ca1\u6709\u4ec0\u4e48\u7279\u522b\u7684\uff0c\u662f\u5417\uff1f\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u4e3a\u6211\u4eec\u6309\u94ae\u7684\u6309\u4e0b\u524d\u540e\u72b6\u6001\u8bbe\u8ba1\u4e0d\u540c\u7684\u597d\u770b\u7684\u6837\u5f0f\uff0c\u4e0b\u9762\u8fd9\u4e2a\u662f\u6211\u81ea\u5df1\u60f3\u7684\uff1a<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u666e\u901a\u72b6\u6001\u4e0b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \u6309\u4e0b\u72b6\u6001<br \/><img decoding=\"async\" src=\"http:\/\/www.poloo.org\/wp-content\/attachments\/month_1010\/g2010107115819.gif\" \/><\/p>\n<p>&nbsp;&nbsp;\u6211\u4eec\u5c06\u4f1a\u628a\u6309\u94ae\u7684\u8fd9\u4e24\u79cd\u72b6\u6001\u7684\u80cc\u666f\u56fe\u7247\u5408\u6210\u5728 \u4e00\u5f20\u56fe\u7247\u4e0a\u3002\u5982\u679c\u8981\u5207\u6362\u666e\u901a\u72b6\u6001\u548c\u6309\u4e0b\u4e24\u79cd\u72b6\u6001\uff0c\u6211\u4eec\u5c31\u53ea\u9700\u8981\u5c06\u8fd9\u5f20\u80cc\u666f\u56fe\u7247\u7684\u7ad6\u76f4\u65b9\u5411\u7684\u4f4d\u7f6e\u53d8\u5316\u4e00\u4e0b\u5c31\u53ef\u4ee5\u4e86\u3002\u8fd9\u79cd\u4ee5css\u4e3a\u4e3b\u7684\u65b9\u6cd5\u53ef\u4f7f\u6211\u4eec\u53ef\u4ee5\u4e0d\u662f\u7528javascript\u811a\u672c\u513f\u5b8c\u6210\u6309\u94ae\u80cc\u666f\u56fe\u7247\u7684\u5207\u6362\u3002\u8ba9\u6211\u4eec\u5427\u8fd9\u4e24\u5f20\u56fe\u7247\u5408\u5e76\u8d77\u6765\u5e76\u4f5c\u4e3a\u6211\u4eec\u7684\u6ed1\u52a8\u95e8\u56fe\u7247\uff0c\u6211\u4eec\u628a\u627f\u88c5\u6309\u94ae\u6587\u672c\u7684\u90a3\u4e2a\u56fe\u7247\u7684\u5bbd\u5ea6\u8bbe\u7f6e\u4e3a300px\uff08\u5e94\u8be5\u8db3\u591f\u4e86\u5427^_^\uff09\uff0c\u56fe\u7247\u7684\u9ad8\u5ea6\u8bbe\u7f6e\u4e3a24px\u3002<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SPAN\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000<br \/><img decoding=\"async\" src=\"http:\/\/www.poloo.org\/wp-content\/attachments\/month_1010\/42010107115930.gif\" \/><br \/>\u3000\u3000A<br \/><img decoding=\"async\" src=\"http:\/\/www.poloo.org\/wp-content\/attachments\/month_1010\/52010107115959.gif\" \/><\/p>\n<p><strong>\u7b2c\u4e8c\u6b65\uff1a\u4e3a\u6309\u94ae\u52a0\u4e0a\u6837\u5f0f<\/strong><br \/>&nbsp;&nbsp;\u6700\u540e\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528css\u5c06\u8fd9\u4e9b\u60f3\u6cd5\u94fe\u63a5\u8d77\u6765\u3002\u6211\u4eec\u53ef\u80fd\u9700\u8981\u628a\u8bb8\u591a\u8fd9\u6837\u7684\u6309\u94ae\u6c34\u5e73\u6392\u6210\u4e00\u884c\uff0c\u6240\u4ee5\u6211\u4f7f\u7528\u4e86\u6d6e\u52a8\u3002<br \/><code><br \/>.clear { \/* generic container (i.e. div) for floating buttons *\/<br \/>&nbsp;&nbsp;&nbsp;&nbsp;overflow: hidden;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;width: 100%;<br \/>}<\/p>\n<p>a.button {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;background: transparent url('bg_button_a.gif') no-repeat scroll top right;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;color: #444;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;display: block;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;float: left;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;font: normal 12px arial, sans-serif;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;height: 24px;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;margin-right: 6px;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;padding-right: 18px; \/* sliding doors padding *\/<br \/>&nbsp;&nbsp;&nbsp;&nbsp;text-decoration: none;<br \/>}<\/p>\n<p>a.button span {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;background: transparent url('bg_button_span.gif') no-repeat;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;display: block;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;line-height: 14px;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;padding: 5px 0 5px 18px;<br \/>} <\/p>\n<p><\/code><\/p>\n<p><u>\u6ce8\u610f\uff1a\u4e00\u5b9a\u8981\u4fdd\u8bc1span\u6807\u7b7e\u7684\u7ad6\u76f4\u65b9\u5411\u7684padding\uff085px+5px\uff09\u518d\u52a0\u4e0aline-height\uff0814px\uff09\u7684\u603b\u548c\u662f\u6211\u4eec\u7684button\u7684\u9ad8\u5ea624px\u3002\u4f7f\u7528\u4e0d\u540c\u7684padding\u610f\u5473\u7740\u6211\u4eec\u7684\u6309\u94ae\u4f1a\u6709\u4e0d\u540c\u7684\u9ad8\u5ea6\u3002<\/u><br \/>&nbsp;&nbsp;\u8fd9\u6837\u6211\u4eec\u4e00\u4e2a\u6f02\u4eae\u7684\u6309\u94ae\u5c31\u8bde\u751f\u4e86\uff0c\u4f46\u662f\u5f53\u6211\u4eec\u53bb\u70b9\u51fb\u5b83\u7684\u65f6\u5019\u6211\u4eec\u5e76\u4e0d\u80fd\u591f\u83b7\u5f97\u5f88\u597d\u7684\u89c6\u89c9\u4e0a\u7684\u53cd\u9988\uff0c\u4ea4\u4e92\u6027\u4e0d\u597d\u3002\u6240\u4ee5\uff0c\u8ba9\u6211\u4eec\u5728\u4f4d\u8fd9\u4e2a\u6309\u94ae\u8865\u4e0a\u6700\u540e\u4e00\u7b14\uff1a<\/p>\n<p><code><br \/>a.button:active {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;background-position: bottom right;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;color: #000;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;outline: none; \/* hide dotted outline in Firefox *\/<br \/>}<\/p>\n<p>a.button:active span {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;background-position: bottom left;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;padding: 6px 0 4px 18px; \/* push text down 1px *\/<br \/>} <\/p>\n<p><\/code><\/p>\n<p><strong>\u7b2c\u4e09\u6b65\uff1a\u4e00\u4e2a\u5bf9ie\u7684\u4e0d\u540c\u7684\u5904\u7406\u65b9\u6cd5<\/strong><br \/>&nbsp;&nbsp;\u771f\u662f\u4ee4\u4eba\u626b\u5174\uff0c\u5f53\u4f60\u5728ie\u6d4f\u89c8\u5668\u91cc\u9762\u70b9\u51fb\u8fd9\u4e2a\u6309\u94ae\u7684\u65f6\u5019\uff0c\u4f60\u4f1a\u53d1\u73b0\u70b9\u51fb\u91ca\u653e\u4e4b\u540e\u6309\u94ae\u4e0d\u4f1a\u518d\u56de\u5230\u539f\u6765\u7684\u72b6\u6001\u3002\u4e3a\u4e86\u907f\u514d\u8fd9\u4e2aie\u91cc\u9762\u7684\u95ee\u9898\uff0c\u6211\u4eec\u9700\u8981\u5728a\u6807\u7b7e\u91cc\u9762\u52a0\u4e0a\u4e00\u70b9\u70b9\u7684javascript\u811a\u672c\u3002<\/p>\n<p><code><br \/>&lt;a class=\"button\" href=\"#\" onclick=\"this.blur();\"&gt; \u2026 &lt;\/a&gt;<br \/><\/code><br \/>&nbsp;&nbsp;\u5047\u5982\u4f60\u60f3\u4f7f\u7528\u8fd9\u4e2a\u6309\u94ae\u6765\u63d0\u4ea4\u8868\u5355\uff0c\u90a3\u4f60\u53ef\u4ee5\u4e3a\u8fd9\u4e2aa\u6807\u7b7e\u7684click\u4e8b\u4ef6\u6dfb\u52a0\u66f4\u591a\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u82f1\u6587\u539f\u6587\uff1aHow to make sexy buttons with css <br \/>\u4f5c\u8005\uff1aAlex<br \/>\u5730\u5740\uff1a<a href=\"http:\/\/www.oscaralexander.com\/tutorials\/how-to-make-sexy-buttons-with-css.html\" target=\"_blank\" rel=\"external\">http:\/\/www.oscaralexander.com\/tutorials\/how-to-make-sexy-buttons-with-css.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u662f\u4e00\u4e2a\u6559\u7a0b\uff0c\u4f5c\u8005Alex\u4e00\u6b65\u6b65\u5730\u53eb\u6211\u4eec\u600e\u6837\u4f7f\u7528css\u6765\u5236\u4f5c\u4e00\u4e2a\u8ff7\u4eba&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-529","post","type-post","status-publish","format-standard","hentry","category-Dream"],"_links":{"self":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=529"}],"version-history":[{"count":0,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/529\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}