{"id":25435,"date":"2024-11-24T13:59:14","date_gmt":"2024-11-24T05:59:14","guid":{"rendered":"https:\/\/fwq.ai\/blog\/25435\/"},"modified":"2024-11-24T13:59:14","modified_gmt":"2024-11-24T05:59:14","slug":"%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e4%bc%98%e9%9b%85%e7%9a%84css%e6%82%ac%e5%81%9c%e6%95%88%e6%9e%9c%ef%bc%9a%e6%af%8f%e8%a1%8c%e6%96%87%e6%9c%ac%e6%82%ac%e5%81%9c%e6%97%b6%e9%83%bd%e5%87%ba-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/25435\/","title":{"rendered":"\u5982\u4f55\u5b9e\u73b0\u4f18\u96c5\u7684CSS\u60ac\u505c\u6548\u679c\uff1a\u6bcf\u884c\u6587\u672c\u60ac\u505c\u65f6\u90fd\u51fa\u73b0\u4e0b\u5212\u7ebf\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173061216415975.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u5b9e\u73b0\u4f18\u96c5\u7684CSS\u60ac\u505c\u6548\u679c\uff1a\u6bcf\u884c\u6587\u672c\u60ac\u505c\u65f6\u90fd\u51fa\u73b0\u4e0b\u5212\u7ebf\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u5b9e\u73b0\u4f18\u96c5\u7684CSS\u60ac\u505c\u6548\u679c\uff1a\u6bcf\u884c\u6587\u672c\u60ac\u505c\u65f6\u90fd\u51fa\u73b0\u4e0b\u5212\u7ebf\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u4f18\u96c5\u7684\u60ac\u505c\u6548\u679c\uff0c\u8ba9\u6bcf\u4e00\u884c\u90fd\u6709\u4e0b\u5212\u7ebf<\/strong><\/p>\n<p>\u5f53\u524d\u60ac\u505c\u65f6\u4ec5\u4f1a\u6709\u4e00\u884c\u6587\u672c\u51fa\u73b0\u4e0b\u5212\u7ebf\uff0c\u5982\u4f55\u8ba9\u6bcf\u4e00\u884c\u6587\u672c\u5728\u60ac\u505c\u65f6\u90fd\u51fa\u73b0\u4e0b\u5212\u7ebf\uff1f<\/p>\n<p>\u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u5c06 p \u6807\u7b7e\u6807\u8bb0\u4e3a inline \u5373\u53ef\uff1a<\/p>\n<pre>.test {\n  display: inline;\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0b\u662f\u5b8c\u6574\u4ee3\u7801\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<pre>&lt;!doctype html&gt;\n&lt;html lang=\"en\"&gt;\n\n&lt;head&gt;\n  &lt;meta charset=\"utf-8\"&gt;\n  &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"&gt;\n  &lt;title&gt;Html Template&lt;\/title&gt;\n&lt;\/head&gt;\n\n&lt;body class=\"dark\"&gt;\n  &lt;style&gt;\n    .box-3 {\n      display: inline-block;\n      padding: 3rem;\n      border: 3px solid red;\n    }\n\n    .box-3&gt;p {\n      position: relative;\n    }\n\n    .box-3&gt;p:after {\n      content: '';\n      width: 0;\n      height: 3px;\n      position: absolute;\n      top: 100%;\n      left: 0;\n      transition: all .5s;\n      background: green;\n    }\n\n    .box-3:hover&gt;p:after {\n      width: 100%;\n    }\n\n    .test {\n      display: inline;\n      transition: all .5s;\n      background: linear-gradient(270deg, #00000036, #00ff53cf) 0 0;\n      background: linear-gradient(270deg, #00ff53cf, #00ff53cf) 0 0;\n      background-size: 100% 2px;\n      background-repeat: no-repeat;\n      background-position: 0% 100%;\n      background-size: 0% 2px;\n    }\n\n    .test:hover {\n      background: linear-gradient(270deg, #00000036, #00ff53cf) 0 0;\n      background: linear-gradient(270deg, #00ff53cf, #00ff53cf) 0 0;\n      background-size: 100% 2px;\n      background-repeat: no-repeat;\n      background-position: 0% 100%;\n    }\n  &lt;\/style&gt;\n  &lt;main&gt;\n    &lt;div class=\"container py-5\"&gt;\n      &lt;div class=\"box-3\"&gt;\n        &lt;p&gt;\n          \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c\n          \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c\n          \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c\n          \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c\n          \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c\n        &lt;\/p&gt;\n        &lt;p&gt;\n          \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c\n        &lt;\/p&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n  &lt;\/main&gt;\n  &lt;p class=\"test\"&gt;\n    \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c\n    \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c\n    \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u662f\u4e00\u6bb5\u6d4b\u8bd5\u6587\u672c \u8fd9\u4e00\u6bb5...\n  &lt;\/p&gt;\n&lt;\/body&gt;\n\n&lt;\/html&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5b9e\u73b0\u4f18\u96c5\u7684CSS\u60ac\u505c\u6548\u679c\uff1a\u6bcf\u884c\u6587\u672c\u60ac\u505c\u65f6\u90fd\u51fa\u73b0\u4e0b\u5212\u7ebf\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f18\u96c5\u7684\u60ac\u505c\u6548\u679c\uff0c\u8ba9\u6bcf\u4e00\u884c\u90fd\u6709\u4e0b\u5212\u7ebf \u5f53\u524d\u60ac\u505c\u65f6\u4ec5\u4f1a\u6709\u4e00\u884c\u6587\u672c\u51fa\u73b0\u4e0b\u5212\u7ebf\uff0c\u5982\u4f55\u8ba9\u6bcf\u4e00\u884c\u6587\u672c\u5728\u60ac\u505c\u65f6\u90fd\u51fa\u73b0\u4e0b\u5212\u7ebf\uff1f \u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u5c06 p \u6807\u7b7e\u6807\u8bb0\u4e3a inline \u5373\u53ef\uff1a .test { display: inline; } \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0b\u662f\u5b8c\u6574\u4ee3\u7801\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b &lt;!doctype html&gt; &lt;html lang=&#8221;en&#8221;&gt; &lt;head&gt; &lt;meta charset=&#8221;utf-8&#8243;&gt; &lt;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width, initial-scale=1&#8243;&gt; &lt;title&gt;Html Template&lt;\/title&gt; &lt;\/head&gt; &lt;body class=&#8221;dark&#8221;&gt; &lt;style&gt; .box-3 { display: inline-block; padding: 3rem; border: 3px solid red; } .box-3&gt;p { position: relative; } .box-3&gt;p:after { content: &#8221;; width: 0; height: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-25435","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=25435"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/25435\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=25435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=25435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=25435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}