{"id":181,"date":"2024-12-12T23:24:35","date_gmt":"2024-12-12T15:24:35","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=181"},"modified":"2024-12-12T23:24:35","modified_gmt":"2024-12-12T15:24:35","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-css-%e5%88%9b%e5%bb%ba%e5%b8%a6%e6%9c%89%e5%bc%a7%e5%bd%a2%e9%80%8f%e6%98%8e%e8%83%8c%e6%99%af%e7%9a%84%e6%96%b9%e5%bd%a2%e6%95%88%e6%9e%9c%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2024\/12\/12\/%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-css-%e5%88%9b%e5%bb%ba%e5%b8%a6%e6%9c%89%e5%bc%a7%e5%bd%a2%e9%80%8f%e6%98%8e%e8%83%8c%e6%99%af%e7%9a%84%e6%96%b9%e5%bd%a2%e6%95%88%e6%9e%9c%ef%bc%9f\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 CSS \u521b\u5efa\u5e26\u6709\u5f27\u5f62\u900f\u660e\u80cc\u666f\u7684\u65b9\u5f62\u6548\u679c\uff1f"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u4f7f\u7528 CSS \u521b\u5efa\u4e00\u4e2a\u65b9\u5f62\u3001\u5f27\u5f62\u5e76\u5e26\u900f\u660e\u80cc\u666f\u7684\u5143\u7d20\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\u5b9e\u73b0\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4\u548c\u4ee3\u7801\u793a\u4f8b\uff1a<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u65b9\u6cd5\u4e00\uff1a\u4f7f\u7528 <code>border-radius<\/code> \u548c\u900f\u660e\u80cc\u666f\u989c\u8272<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>border-radius<\/code> \u5c5e\u6027\u53ef\u4ee5\u4e3a\u5143\u7d20\u521b\u5efa\u5706\u89d2\uff0c\u540c\u65f6\u7ed3\u5408\u900f\u660e\u80cc\u666f\u8272\u5b9e\u73b0\u6548\u679c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u793a\u4f8b\u4ee3\u7801\uff1a<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n&lt;meta charset=\"UTF-8\"&gt;\n&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n&lt;title&gt;\u65b9\u5f62\u5f27\u5f62\u900f\u660e\u80cc\u666f&lt;\/title&gt;\n&lt;style&gt;\n  .arc-square {\n    width: 200px; \/* \u8bbe\u7f6e\u65b9\u5f62\u7684\u5bbd\u5ea6 *\/\n    height: 200px; \/* \u8bbe\u7f6e\u65b9\u5f62\u7684\u9ad8\u5ea6 *\/\n    background-color: rgba(0, 0, 0, 0.5); \/* \u9ed1\u8272\u534a\u900f\u660e\u80cc\u666f *\/\n    border-radius: 25%; \/* \u5706\u89d2\u8bbe\u7f6e\u4e3a25%\uff0c\u521b\u5efa\u5f27\u5f62\u6548\u679c *\/\n  }\n&lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;div class=\"arc-square\"&gt;&lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u89e3\u91ca\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>background-color: rgba(0, 0, 0, 0.5);<\/code>\uff1a\u4f7f\u7528 RGBA \u683c\u5f0f\u8bbe\u7f6e\u900f\u660e\u80cc\u666f\u8272\uff0c\u6700\u540e\u4e00\u4e2a\u53c2\u6570\u4e3a\u900f\u660e\u5ea6\uff080~1\uff09\u3002<\/li>\n\n\n\n<li><code>border-radius: 25%;<\/code>\uff1a\u901a\u8fc7\u767e\u5206\u6bd4\u8bbe\u7f6e\u5706\u89d2\uff0c\u63a7\u5236\u5f27\u5f62\u7a0b\u5ea6\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u65b9\u6cd5\u4e8c\uff1a\u4f7f\u7528\u4f2a\u5143\u7d20\u589e\u5f3a\u6548\u679c<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u4f7f\u7528\u4f2a\u5143\u7d20 <code>::before<\/code> \u548c <code>::after<\/code> \u6dfb\u52a0\u66f4\u591a\u5f27\u5f62\u6837\u5f0f\u6216\u8c03\u6574\u80cc\u666f\u900f\u660e\u6548\u679c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u793a\u4f8b\u4ee3\u7801\uff1a<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n&lt;meta charset=\"UTF-8\"&gt;\n&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n&lt;title&gt;\u4f2a\u5143\u7d20\u5f27\u5f62\u900f\u660e\u80cc\u666f&lt;\/title&gt;\n&lt;style&gt;\n  .arc-square {\n    position: relative;\n    width: 200px;\n    height: 200px;\n    background-color: rgba(0, 0, 255, 0.3); \/* \u84dd\u8272\u534a\u900f\u660e *\/\n    border-radius: 15%; \/* \u521b\u5efa\u5706\u89d2 *\/\n    overflow: hidden; \/* \u88c1\u526a\u5b50\u5143\u7d20 *\/\n  }\n\n  .arc-square::before {\n    content: '';\n    position: absolute;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n    background: rgba(255, 255, 255, 0.1); \/* \u767d\u8272\u900f\u660e\u53e0\u52a0 *\/\n    border-radius: inherit;\n    transform: rotate(45deg); \/* \u65cb\u8f6c\u6dfb\u52a0\u5f27\u5f62\u6548\u679c *\/\n  }\n&lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;div class=\"arc-square\"&gt;&lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u89e3\u91ca\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f2a\u5143\u7d20 <code>::before<\/code> \u8986\u76d6\u4e3b\u5143\u7d20\uff0c\u53e0\u52a0\u4e00\u4e2a\u900f\u660e\u80cc\u666f\uff0c\u5e76\u901a\u8fc7\u65cb\u8f6c\u548c\u5706\u89d2\u8fdb\u4e00\u6b65\u589e\u5f3a\u89c6\u89c9\u6548\u679c\u3002<\/li>\n\n\n\n<li><code>overflow: hidden;<\/code> \u786e\u4fdd\u4f2a\u5143\u7d20\u4e0d\u4f1a\u6ea2\u51fa\u4e3b\u5143\u7d20\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u65b9\u6cd5\u4e09\uff1a\u4f7f\u7528 <code>clip-path<\/code> \u521b\u5efa\u81ea\u5b9a\u4e49\u5f27\u5f62<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>clip-path<\/code> \u5c5e\u6027\u53ef\u4ee5\u5b9a\u4e49\u4efb\u610f\u5f62\u72b6\u7684\u88c1\u526a\u8def\u5f84\uff0c\u4ece\u800c\u5b9e\u73b0\u5f27\u5f62\u900f\u660e\u80cc\u666f\u6548\u679c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u793a\u4f8b\u4ee3\u7801\uff1a<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n&lt;meta charset=\"UTF-8\"&gt;\n&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n&lt;title&gt;clip-path \u5f27\u5f62\u900f\u660e\u80cc\u666f&lt;\/title&gt;\n&lt;style&gt;\n  .arc-square {\n    width: 200px;\n    height: 200px;\n    background-color: rgba(0, 0, 0, 0.5); \/* \u534a\u900f\u660e\u80cc\u666f *\/\n    clip-path: polygon(0% 0%, 100% 0%, 100% 80%, 50% 100%, 0% 80%); \/* \u81ea\u5b9a\u4e49\u5f27\u5f62 *\/\n  }\n&lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;div class=\"arc-square\"&gt;&lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u89e3\u91ca\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>clip-path: polygon(...)<\/code>\uff1a\u5b9a\u4e49\u4e00\u4e2a\u7531\u591a\u4e2a\u70b9\u6784\u6210\u7684\u591a\u8fb9\u5f62\uff0c\u7528\u4e8e\u88c1\u526a\u5143\u7d20\u7684\u663e\u793a\u533a\u57df\u3002\u4e0a\u8ff0\u4ee3\u7801\u88c1\u526a\u4e86\u4e00\u4e2a\u9876\u90e8\u65b9\u5f62\u3001\u5e95\u90e8\u5f27\u5f62\u7684\u80cc\u666f\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u65b9\u6cd5\u56db\uff1a\u7ed3\u5408\u6e10\u53d8\u80cc\u666f\u5b9e\u73b0\u5f27\u5f62\u900f\u660e<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528 CSS \u6e10\u53d8\u80cc\u666f\u548c\u900f\u660e\u8272\uff0c\u6a21\u62df\u5f27\u5f62\u6548\u679c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u793a\u4f8b\u4ee3\u7801\uff1a<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n&lt;meta charset=\"UTF-8\"&gt;\n&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n&lt;title&gt;\u6e10\u53d8\u5f27\u5f62\u900f\u660e\u80cc\u666f&lt;\/title&gt;\n&lt;style&gt;\n  .arc-square {\n    width: 200px;\n    height: 200px;\n    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 80%);\n    border-radius: 25%;\n  }\n&lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;div class=\"arc-square\"&gt;&lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u89e3\u91ca\uff1a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>linear-gradient<\/code>\uff1a\u8bbe\u7f6e\u4ece\u4e0a\u5230\u4e0b\u7684\u6e10\u53d8\uff0c\u9876\u90e8\u4e3a\u534a\u900f\u660e\u9ed1\u8272\uff0c\u5e95\u90e8\u9010\u6e10\u900f\u660e\u3002<\/li>\n\n\n\n<li><code>border-radius<\/code>\uff1a\u8fdb\u4e00\u6b65\u5f27\u5316\u8fb9\u89d2\uff0c\u589e\u52a0\u89c6\u89c9\u67d4\u548c\u5ea6\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u603b\u7ed3<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7b80\u5355\u5b9e\u73b0<\/strong>\uff1a\u4f7f\u7528 <code>border-radius<\/code> \u548c\u900f\u660e\u80cc\u666f\u8272\u662f\u6700\u76f4\u63a5\u7684\u65b9\u5f0f\u3002<\/li>\n\n\n\n<li><strong>\u9ad8\u7ea7\u6548\u679c<\/strong>\uff1a\u7ed3\u5408\u4f2a\u5143\u7d20\u3001<code>clip-path<\/code> \u548c\u6e10\u53d8\u80cc\u666f\uff0c\u53ef\u4ee5\u5b9e\u73b0\u66f4\u590d\u6742\u7684\u5f27\u5f62\u548c\u900f\u660e\u80cc\u666f\u3002<\/li>\n\n\n\n<li><strong>\u8de8\u6d4f\u89c8\u5668\u652f\u6301<\/strong>\uff1a\u8bf7\u786e\u4fdd\u5bf9 <code>clip-path<\/code> \u548c <code>rgba<\/code> \u7684\u517c\u5bb9\u6027\u6d4b\u8bd5\uff0c\u7279\u522b\u662f\u5728\u8f83\u65e7\u7684\u6d4f\u89c8\u5668\u4e2d\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u6839\u636e\u9879\u76ee\u9700\u6c42\u9009\u62e9\u6700\u9002\u5408\u7684\u65b9\u6848\uff0c\u8fdb\u4e00\u6b65\u4f18\u5316\u89c6\u89c9\u6548\u679c\uff01<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0a\u4e3a\u4f7f\u7528 CSS \u521b\u5efa\u5e26\u6709\u5f27\u5f62\u900f\u660e\u80cc\u666f\u7684\u65b9\u5f62\u6548\u679c\u7684\u8be6\u7ec6\u4ecb\u7ecd\uff0c\u66f4\u591a\u4fe1\u606f\u8bf7\u5173\u6ce8\u5176\u4ed6\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528 CSS \u521b\u5efa\u4e00\u4e2a\u65b9\u5f62\u3001\u5f27\u5f62\u5e76\u5e26\u900f\u660e\u80cc\u666f\u7684\u5143\u7d20\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u6cd5\u5b9e\u73b0\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4\u548c\u4ee3\u7801\u793a\u4f8b\uff1a \u65b9\u6cd5 [&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-181","post","type-post","status-publish","format-standard","hentry","category-css"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/181","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=181"}],"version-history":[{"count":1,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":182,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/181\/revisions\/182"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}