{"id":1822,"date":"2025-02-20T20:53:45","date_gmt":"2025-02-20T12:53:45","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=1822"},"modified":"2025-02-20T20:53:45","modified_gmt":"2025-02-20T12:53:45","slug":"css3-%e5%9c%86%e8%a7%92","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2025\/02\/20\/css3-%e5%9c%86%e8%a7%92\/","title":{"rendered":"CSS3 \u5706\u89d2"},"content":{"rendered":"\n<p><strong>CSS3 \u5706\u89d2<\/strong>\uff0c\u8fd9\u4e2a\u662f\u7f51\u9875\u8bbe\u8ba1\u4e2d\u5e38\u89c1\u7684\u6548\u679c\u3002\u5706\u89d2\u4e0d\u4ec5\u80fd\u8ba9\u9875\u9762\u770b\u8d77\u6765\u66f4\u52a0\u67d4\u548c\u548c\u73b0\u4ee3\u5316\uff0c\u800c\u4e14\u80fd\u7528\u4e8e\u5404\u79cd\u5143\u7d20\uff0c\u5982\u6309\u94ae\u3001\u8f93\u5165\u6846\u3001\u56fe\u7247\u7b49\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. <strong><code>border-radius<\/code> \u57fa\u7840<\/strong><\/h3>\n\n\n\n<p><code>border-radius<\/code> \u5c5e\u6027\u7528\u4e8e\u4e3a\u5143\u7d20\u7684\u8fb9\u6846\u6dfb\u52a0\u5706\u89d2\u3002\u5b83\u53ef\u4ee5\u8bbe\u7f6e\u5143\u7d20\u7684\u56db\u4e2a\u89d2\uff0c\u6216\u8005\u53ea\u8bbe\u7f6e\u67d0\u4e9b\u89d2\u7684\u5706\u89d2\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u8bed\u6cd5\uff1a<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>border-radius: &lt;length&gt; | &lt;percentage&gt;;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;length><\/code>\uff1a\u901a\u5e38\u662f <code>px<\/code> \u6216 <code>em<\/code>\uff0c\u6307\u5b9a\u89d2\u7684\u5706\u5ea6\u3002<\/li>\n\n\n\n<li><code>&lt;percentage><\/code>\uff1a\u767e\u5206\u6bd4\u503c\uff0c\u8868\u793a\u89d2\u7684\u5706\u5ea6\u76f8\u5bf9\u4e8e\u5143\u7d20\u7684\u5bbd\u5ea6\u6216\u9ad8\u5ea6\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u793a\u4f8b\uff1a<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>div {\n    width: 200px;\n    height: 100px;\n    background-color: lightblue;\n    border-radius: 20px; \/* \u7ed9\u6240\u6709\u56db\u4e2a\u89d2\u6dfb\u52a0\u5706\u89d2 *\/\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. <strong>\u5206\u522b\u8bbe\u7f6e\u56db\u4e2a\u89d2\u7684\u5706\u89d2<\/strong><\/h3>\n\n\n\n<p>\u4f60\u8fd8\u53ef\u4ee5\u5355\u72ec\u4e3a\u6bcf\u4e2a\u89d2\u8bbe\u7f6e\u4e0d\u540c\u7684\u5706\u89d2\u534a\u5f84\uff0c\u8fd9\u6837\u53ef\u4ee5\u5b9e\u73b0\u66f4\u52a0\u7075\u6d3b\u7684\u6548\u679c\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u8bed\u6cd5\uff1a<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>border-radius: &lt;top-left&gt; &lt;top-right&gt; &lt;bottom-right&gt; &lt;bottom-left&gt;;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;top-left><\/code>\uff1a\u5de6\u4e0a\u89d2\u5706\u89d2\u7684\u534a\u5f84\u3002<\/li>\n\n\n\n<li><code>&lt;top-right><\/code>\uff1a\u53f3\u4e0a\u89d2\u5706\u89d2\u7684\u534a\u5f84\u3002<\/li>\n\n\n\n<li><code>&lt;bottom-right><\/code>\uff1a\u53f3\u4e0b\u89d2\u5706\u89d2\u7684\u534a\u5f84\u3002<\/li>\n\n\n\n<li><code>&lt;bottom-left><\/code>\uff1a\u5de6\u4e0b\u89d2\u5706\u89d2\u7684\u534a\u5f84\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u793a\u4f8b\uff1a<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>div {\n    width: 200px;\n    height: 100px;\n    background-color: lightgreen;\n    border-radius: 10px 20px 30px 40px; \/* \u56db\u4e2a\u89d2\u5206\u522b\u8bbe\u7f6e\u4e0d\u540c\u7684\u5706\u89d2 *\/\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. <strong>\u4f7f\u7528\u767e\u5206\u6bd4\u503c\u8bbe\u7f6e\u5706\u89d2<\/strong><\/h3>\n\n\n\n<p>\u5f53\u4f7f\u7528\u767e\u5206\u6bd4\u6765\u8bbe\u7f6e <code>border-radius<\/code> \u65f6\uff0c\u5706\u89d2\u7684\u5927\u5c0f\u662f\u6839\u636e\u5143\u7d20\u7684\u5bbd\u5ea6\u548c\u9ad8\u5ea6\u6765\u8ba1\u7b97\u7684\u3002\u5982\u679c\u5143\u7d20\u7684\u5bbd\u5ea6\u548c\u9ad8\u5ea6\u76f8\u7b49\uff08\u4f8b\u5982\u6b63\u65b9\u5f62\uff09\uff0c\u90a3\u4e48\u767e\u5206\u6bd4\u8bbe\u7f6e\u4f1a\u4f7f\u5143\u7d20\u53d8\u6210\u4e00\u4e2a\u5706\u5f62\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u793a\u4f8b\uff1a<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>div {\n    width: 200px;\n    height: 200px;\n    background-color: lightcoral;\n    border-radius: 50%; \/* \u5c06\u5143\u7d20\u8f6c\u4e3a\u5706\u5f62 *\/\n}<\/code><\/pre>\n\n\n\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>50%<\/code> \u4f7f\u5143\u7d20\u7684\u89d2\u6210\u4e3a\u5706\u5f62\uff0c\u4ece\u800c\u5f62\u6210\u4e00\u4e2a\u5706\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. <strong>\u692d\u5706\u5f62\u5706\u89d2\uff08Elliptical Border Radius\uff09<\/strong><\/h3>\n\n\n\n<p><code>border-radius<\/code> \u4e0d\u4ec5\u652f\u6301\u5706\u5f62\uff08\u6b63\u65b9\u5f62\uff09\uff0c\u8fd8\u53ef\u4ee5\u652f\u6301\u692d\u5706\u5f62\u3002\u901a\u8fc7\u4e3a\u6c34\u5e73\u534a\u5f84\u548c\u5782\u76f4\u534a\u5f84\u5206\u522b\u6307\u5b9a\u4e0d\u540c\u7684\u503c\uff0c\u53ef\u4ee5\u521b\u9020\u51fa\u692d\u5706\u5f62\u7684\u5706\u89d2\u6548\u679c\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u8bed\u6cd5\uff1a<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>border-radius: &lt;horizontal-radius&gt; &lt;vertical-radius&gt;;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u793a\u4f8b\uff1a<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>div {\n    width: 200px;\n    height: 100px;\n    background-color: lightyellow;\n    border-radius: 50px 25px; \/* \u6c34\u5e73\u534a\u5f84 50px\uff0c\u5782\u76f4\u534a\u5f84 25px\uff0c\u5f62\u6210\u692d\u5706\u5f62\u5706\u89d2 *\/\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">5. <strong>\u4f7f\u7528 <code>border-radius<\/code> \u521b\u5efa\u5706\u5f62\u5143\u7d20<\/strong><\/h3>\n\n\n\n<p>\u901a\u8fc7\u7ec4\u5408\u9002\u5f53\u7684\u5bbd\u9ad8\u548c <code>border-radius<\/code>\uff0c\u4f60\u53ef\u4ee5\u521b\u5efa\u5404\u79cd\u5f62\u72b6\uff0c\u5305\u62ec\u5706\u5f62\u548c\u692d\u5706\u5f62\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u5706\u5f62\u6309\u94ae\uff1a<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>button {\n    width: 100px;\n    height: 100px;\n    background-color: steelblue;\n    color: white;\n    border-radius: 50%; \/* \u5706\u5f62 *\/\n    border: none;\n    text-align: center;\n    line-height: 100px; \/* \u5782\u76f4\u5c45\u4e2d\u6587\u672c *\/\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">6. <strong>\u7ed3\u5408\u5176\u4ed6 CSS3 \u5c5e\u6027\u5b9e\u73b0\u590d\u6742\u6548\u679c<\/strong><\/h3>\n\n\n\n<p><code>border-radius<\/code> \u53ef\u4ee5\u4e0e\u5176\u4ed6 CSS3 \u7279\u6027\u7ed3\u5408\u4f7f\u7528\uff0c\u521b\u9020\u66f4\u591a\u590d\u6742\u548c\u52a8\u6001\u7684\u6548\u679c\u3002\u4f8b\u5982\uff0c\u7ed3\u5408 <code>box-shadow<\/code>\u3001<code>gradient<\/code> \u6216 <code>transition<\/code> \u7b49\u5c5e\u6027\uff0c\u53ef\u4ee5\u8f7b\u677e\u521b\u5efa\u5177\u6709\u5706\u89d2\u7684\u6309\u94ae\u3001\u5361\u7247\u7b49\u5143\u7d20\uff0c\u5e26\u6709\u9634\u5f71\u548c\u6e10\u53d8\u6548\u679c\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u793a\u4f8b\uff08\u5706\u89d2\u6309\u94ae\u52a0\u9634\u5f71\uff09\uff1a<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>button {\n    width: 150px;\n    height: 50px;\n    background-color: tomato;\n    color: white;\n    border-radius: 25px; \/* \u5706\u89d2\u6309\u94ae *\/\n    border: none;\n    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2); \/* \u9634\u5f71 *\/\n    transition: background-color 0.3s ease;\n}\n\nbutton:hover {\n    background-color: darkred; \/* \u9f20\u6807\u60ac\u505c\u65f6\u53d8\u8272 *\/\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">7. <strong>\u5e38\u89c1\u5e94\u7528\u573a\u666f<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6309\u94ae<\/strong>\uff1a\u5706\u89d2\u6309\u94ae\u5e38\u89c1\u4e8e\u73b0\u4ee3\u7f51\u9875\u8bbe\u8ba1\u3002<\/li>\n\n\n\n<li><strong>\u8f93\u5165\u6846<\/strong>\uff1a\u5706\u89d2\u8f93\u5165\u6846\u66f4\u5177\u4eb2\u548c\u529b\uff0c\u5e38\u7528\u5728\u8868\u5355\u8bbe\u8ba1\u4e2d\u3002<\/li>\n\n\n\n<li><strong>\u5361\u7247\u8bbe\u8ba1<\/strong>\uff1a\u7ed9\u5361\u7247\u5143\u7d20\u6dfb\u52a0\u5706\u89d2\uff0c\u5448\u73b0\u66f4\u67d4\u548c\u3001\u73b0\u4ee3\u7684\u8bbe\u8ba1\u98ce\u683c\u3002<\/li>\n\n\n\n<li><strong>\u56fe\u50cf<\/strong>\uff1a\u901a\u8fc7 <code>border-radius<\/code> \u53ef\u4ee5\u8ba9\u56fe\u7247\u7684\u56db\u4e2a\u89d2\u53d8\u5706\uff0c\u6216\u662f\u5c06\u56fe\u7247\u505a\u6210\u5706\u5f62\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u603b\u7ed3<\/h3>\n\n\n\n<p>CSS3 \u7684 <code>border-radius<\/code> \u5c5e\u6027\u975e\u5e38\u5f3a\u5927\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u8f7b\u677e\u5b9e\u73b0\u5706\u89d2\u6548\u679c\u3002\u65e0\u8bba\u662f\u7b80\u5355\u7684\u5706\u89d2\u77e9\u5f62\uff0c\u8fd8\u662f\u590d\u6742\u7684\u692d\u5706\u5f62\u548c\u5706\u5f62\u5143\u7d20\uff0c<code>border-radius<\/code> \u90fd\u53ef\u4ee5\u63d0\u4f9b\u7075\u6d3b\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n\n\n\n<p>\u901a\u8fc7 <code>border-radius<\/code>\uff0c\u4f60\u53ef\u4ee5\u521b\u5efa\u66f4\u52a0\u73b0\u4ee3\u5316\u3001\u67d4\u548c\u7684\u9875\u9762\u8bbe\u8ba1\u3002\u5982\u679c\u4f60\u5c06\u5b83\u4e0e\u5176\u4ed6 CSS3 \u5c5e\u6027\uff08\u5982\u6e10\u53d8\u3001\u9634\u5f71\u3001\u52a8\u753b\u7b49\uff09\u7ed3\u5408\u4f7f\u7528\uff0c\u5c06\u80fd\u591f\u8bbe\u8ba1\u51fa\u66f4\u52a0\u70ab\u9177\u548c\u5438\u5f15\u7528\u6237\u7684\u754c\u9762\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CSS3 \u5706\u89d2\uff0c\u8fd9\u4e2a\u662f\u7f51\u9875\u8bbe\u8ba1\u4e2d\u5e38\u89c1\u7684\u6548\u679c\u3002\u5706\u89d2\u4e0d\u4ec5\u80fd\u8ba9\u9875\u9762\u770b\u8d77\u6765\u66f4\u52a0\u67d4\u548c\u548c\u73b0\u4ee3\u5316\uff0c\u800c\u4e14\u80fd\u7528\u4e8e\u5404\u79cd\u5143\u7d20\uff0c\u5982\u6309\u94ae [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[],"class_list":["post-1822","post","type-post","status-publish","format-standard","hentry","category-css"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/1822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/comments?post=1822"}],"version-history":[{"count":1,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/1822\/revisions"}],"predecessor-version":[{"id":1823,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/1822\/revisions\/1823"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=1822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=1822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=1822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}