{"id":154,"date":"2024-12-10T23:45:29","date_gmt":"2024-12-10T15:45:29","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=154"},"modified":"2024-12-10T23:45:29","modified_gmt":"2024-12-10T15:45:29","slug":"%e5%a6%82%e4%bd%95%e7%94%a8-css3-%e5%ae%9e%e7%8e%b0%e4%b8%80%e4%b8%aa%e5%8d%95%e9%9d%a2%e7%9a%84%e5%80%be%e6%96%9c%e6%95%88%e6%9e%9c%ef%bc%8c%e5%90%8c%e6%97%b6%e5%9c%a8%e8%83%8c%e6%99%af%e4%b8%ad","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2024\/12\/10\/%e5%a6%82%e4%bd%95%e7%94%a8-css3-%e5%ae%9e%e7%8e%b0%e4%b8%80%e4%b8%aa%e5%8d%95%e9%9d%a2%e7%9a%84%e5%80%be%e6%96%9c%e6%95%88%e6%9e%9c%ef%bc%8c%e5%90%8c%e6%97%b6%e5%9c%a8%e8%83%8c%e6%99%af%e4%b8%ad\/","title":{"rendered":"\u5982\u4f55\u7528 CSS3 \u5b9e\u73b0\u4e00\u4e2a\u5355\u9762\u7684\u503e\u659c\u6548\u679c\uff0c\u540c\u65f6\u5728\u80cc\u666f\u4e2d\u6dfb\u52a0\u4e00\u5f20\u56fe\u7247\uff1f"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">\u8981\u7528 CSS3 \u5b9e\u73b0\u4e00\u4e2a\u5355\u9762\u7684\u503e\u659c\u6548\u679c\uff0c\u5e76\u5728\u80cc\u666f\u4e2d\u6dfb\u52a0\u4e00\u5f20\u56fe\u7247\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>HTML \u7ed3\u6784<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u5bb9\u5668\uff0c\u7528\u4e8e\u5c55\u793a\u503e\u659c\u6548\u679c\u548c\u80cc\u666f\u56fe\u7247\u3002<\/p>\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;CSS3 \u5355\u9762\u503e\u659c\u6548\u679c&lt;\/title&gt;\n    &lt;link rel=\"stylesheet\" href=\"styles.css\"&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;div class=\"tilted-box\"&gt;\n        &lt;!-- \u5185\u5bb9\u53ef\u4ee5\u6dfb\u52a0\u5728\u8fd9\u91cc --&gt;\n    &lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>CSS \u5b9e\u73b0<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u8bbe\u7f6e\u57fa\u672c\u6837\u5f0f<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7ed9\u5bb9\u5668\u8bbe\u7f6e\u5bbd\u5ea6\u3001\u9ad8\u5ea6\u548c\u80cc\u666f\u56fe\u7247\u3002<\/li>\n\n\n\n<li>\u4f7f\u7528 <code>background-size: cover<\/code> \u548c <code>background-position: center<\/code> \u786e\u4fdd\u56fe\u7247\u586b\u5145\u5bb9\u5668\u3002<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5e94\u7528\u503e\u659c\u6548\u679c<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528 CSS3 \u7684 <code>transform: skew()<\/code> \u65b9\u6cd5\u7ed9\u5143\u7d20\u6dfb\u52a0\u503e\u659c\u6548\u679c\u3002<\/li>\n\n\n\n<li>\u8bbe\u7f6e <code>overflow: hidden<\/code> \u9632\u6b62\u5143\u7d20\u5185\u5bb9\u6ea2\u51fa\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>\/* styles.css *\/\n\n\/* \u9875\u9762\u57fa\u7840\u6837\u5f0f *\/\nbody {\n    margin: 0;\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    height: 100vh;\n    background-color: #f0f0f0;\n}\n\n\/* \u503e\u659c\u5bb9\u5668 *\/\n.tilted-box {\n    width: 300px;\n    height: 200px;\n    background-image: url('https:\/\/via.placeholder.com\/300x200'); \/* \u66ff\u6362\u4e3a\u5b9e\u9645\u56fe\u7247 URL *\/\n    background-size: cover;\n    background-position: center;\n    transform: skew(-20deg); \/* \u8bbe\u7f6e\u503e\u659c\u89d2\u5ea6 *\/\n    overflow: hidden;\n    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u6548\u679c\u5206\u6790<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u503e\u659c\u53d8\u6362<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528 <code>transform: skew(-20deg)<\/code> \u5c06\u5bb9\u5668\u503e\u659c\u4e00\u4e2a\u56fa\u5b9a\u89d2\u5ea6\u3002<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u80cc\u666f\u56fe\u50cf\u8bbe\u7f6e<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528 <code>background-image<\/code> \u6dfb\u52a0\u80cc\u666f\u56fe\u7247\u3002<\/li>\n\n\n\n<li>\u914d\u5408 <code>background-size: cover<\/code> \u548c <code>background-position: center<\/code>\uff0c\u4fdd\u8bc1\u56fe\u7247\u663e\u793a\u5b8c\u6574\u4e14\u5c45\u4e2d\u3002<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u9632\u6b62\u6ea2\u51fa<\/strong>\uff1a<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>overflow: hidden<\/code> \u9632\u6b62\u503e\u659c\u9020\u6210\u7684\u8fb9\u7f18\u90e8\u5206\u5185\u5bb9\u6ea2\u51fa\u5bb9\u5668\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u589e\u5f3a\u52a8\u6001\u6548\u679c<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u5728\u9f20\u6807\u60ac\u505c\u65f6\uff0c\u6dfb\u52a0\u5e73\u6ed1\u8fc7\u6e21\u6548\u679c\uff0c\u8c03\u6574\u503e\u659c\u89d2\u5ea6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.tilted-box {\n    transition: transform 0.5s ease;\n}\n\n.tilted-box:hover {\n    transform: skew(-10deg); \/* \u9f20\u6807\u60ac\u505c\u65f6\u503e\u659c\u89d2\u5ea6\u53d8\u5c0f *\/\n}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u5b8c\u6574\u4ee3\u7801<\/strong><\/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;CSS3 \u5355\u9762\u503e\u659c\u6548\u679c&lt;\/title&gt;\n    &lt;style&gt;\n        body {\n            margin: 0;\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            height: 100vh;\n            background-color: #f0f0f0;\n        }\n\n        .tilted-box {\n            width: 300px;\n            height: 200px;\n            background-image: url('https:\/\/via.placeholder.com\/300x200');\n            background-size: cover;\n            background-position: center;\n            transform: skew(-20deg);\n            overflow: hidden;\n            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);\n            transition: transform 0.5s ease;\n        }\n\n        .tilted-box:hover {\n            transform: skew(-10deg);\n        }\n    &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;div class=\"tilted-box\"&gt;&lt;\/div&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u5c55\u793a\u7ed3\u679c<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u9ed8\u8ba4\u72b6\u6001<\/strong>\uff1a\u5bb9\u5668\u5e26\u6709\u56fa\u5b9a\u503e\u659c\u89d2\u5ea6\uff0c\u663e\u793a\u80cc\u666f\u56fe\u7247\u3002<\/li>\n\n\n\n<li><strong>\u9f20\u6807\u60ac\u505c<\/strong>\uff1a\u503e\u659c\u89d2\u5ea6\u5e73\u6ed1\u8c03\u6574\uff0c\u63d0\u5347\u52a8\u6001\u6548\u679c\u3002<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u6839\u636e\u9700\u8981\uff0c\u53ef\u4ee5\u81ea\u5b9a\u4e49\u5c3a\u5bf8\u3001\u56fe\u7247\u8def\u5f84\u548c\u503e\u659c\u89d2\u5ea6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8981\u7528 CSS3 \u5b9e\u73b0\u4e00\u4e2a\u5355\u9762\u7684\u503e\u659c\u6548\u679c\uff0c\u5e76\u5728\u80cc\u666f\u4e2d\u6dfb\u52a0\u4e00\u5f20\u56fe\u7247\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a HTML \u7ed3\u6784 \u521b\u5efa\u4e00 [&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-154","post","type-post","status-publish","format-standard","hentry","category-css"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/154","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=154"}],"version-history":[{"count":1,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":155,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/154\/revisions\/155"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}