chrome中ul的padding-left: 40px

本文探讨了Chrome浏览器中UL元素的默认样式,并提供了解决不同浏览器显示差异的方法。通过CSS重置技术,可以有效地统一各个浏览器下列表项的表现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

chrome中,ul具有默认样式

ul, menu, dir {
    display: block;
    list-style-type: disc;
    -webkit-margin-before: 1em;
    -webkit-margin-after: 1em;
    -webkit-margin-start: 0px;
    -webkit-margin-end: 0px;
    -webkit-padding-start: 40px;
}

因此,为了防止不同浏览器的显示不同,应该设置


* {margin:0; padding:0;}

据说上面那个比较占资源)或者用下面这个

body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, table, th, td {margin:0; padding:0;}

参考文章:ul的padding-left:40px问题

<!doctype html> <!DOCTYPE html><html><head><meta charset="utf-8"> <meta name="Author" content="Noah"> <meta name="Keywords" content=""> <meta name="Description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="favicon" href="favicon.ico"> <title>BA综合发布页</title> <meta name="keywords" content="欢迎使用BA综合"> <meta name="description" content="欢迎使用BA综合"> <style>@font-face{font-family:iconfont;src:url(//at.alicdn.com/t/font_1706200_3sgw4esvyq9.eot?t=1584846914425);src:url(//at.alicdn.com/t/font_1706200_3sgw4esvyq9.eot?t=1584846914425#iefix) format('embedded-opentype'),url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAPcAAsAAAAACEAAAAOQAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDMgqDVIMaATYCJAMUCwwABCAFhG0HUhswBxEVnPHIfiZkcgn7O+8oo66bEbK2OpSJxjfBA+X1vslMtll8iBW0KuzdSry1J/JGpwASAA0EaO7O95urXT4WOkKV5Nojj7b4hwrpy2SO/v97p78xLfvYuvYslzWHLex8DDAOpEDHnGQljg3TC+cUPEjbIQAHqRRD1GvQzI2BgvQTgBjYr083jJQNVcMRGEZbyVSVKhajY2hztCvAIv178YYywgANXUJ2atW7fk9qmZi1ZMCSjnILC8fbDUAHJFAMUCCGl/oGIm2uGBKHP1RRC3BgoKGZmLxVUbOWZcWqHRkc9A8PBBKFBsIGKXUBUAvlFZhwBAGmhiDBLIqgwKyVRwPuKwAOWAjCWUxL9mpIWOWKcikVmuwiF0+49sx9/bnn5gvfDdO/at6eQHTP5dHLd8Z6V67btSPG061Q523w0S5OzYETx4QbT9zXbnmuP/bdvOsL9lwR2D031utePndvMM7nXRncNy/G4xvlEveE69fc4Tdu+AbcnOdxa4E98/bFyZV75+5WxGRRnfY0cEulpaqbVCzNtxTEU1P1m2J4tFGwJ7VcytpevcrWOXd44oCjAyZu3DXRvQxryi09PV2/BcVQIlRxZPWvAFhMXkb1qQ3bHPFvOVXxWI1TjTLPFjtT5smFsAtxVqK82CcvekwcsbMOHDh4wOBxYw4eZI+NVR+A6Vmx4bGz1ZI0XFw1r0mlXm20lW5RpWd+s0u/ijYZwarmHJsZVi+tXKjMlU2rm186Hlk6tFxaPfwAWLPk3380K2u4Qm6xtmaprTL4b/dj0Nu/F+qwat8MpwLgzvpfdbSsPbbVBj9Ijy//kxa1tAb7qAqUxK4rT8490qpVpxGATiESBDT4aTX/LxTJg3H0MbPIZMAgJgaNIqSAxCCbpGjFQMdJObBhUBMcFKXhbCdRDEcilB0oZAYAQTiHQCOU4yAJ5ypJ0e6DTizvwEa4kODAK6KWdJIrLP1uHgWtYqDuj3zPi2FOvTHlb7BpaiWp1NwvSPRJKrMiW3zFAhljRPy2laohIzzTC9gN08S0Cgf0mjnV9ZLnpuxDWc/z5oZHQasYqPsj3/NiZGO9yX3/DTZNrdQQ+qJfkOjbpzIrWpBedUsrwrXcEr9tpWrICM/0AjyYaI5pLe8U0GvmemTWS47qmba6bH7D/IybAAdkZV1oQgoldGHjYViCYPl3WKxb86g+On/sE/+kc/CLtS1vNg==') format('woff2'),url(//at.alicdn.com/t/font_1706200_3sgw4esvyq9.woff?t=1584846914425) format('woff'),url(//at.alicdn.com/t/font_1706200_3sgw4esvyq9.ttf?t=1584846914425) format('truetype'),url(//at.alicdn.com/t/font_1706200_3sgw4esvyq9.svg?t=1584846914425#iconfont) format('svg')}.iconfont{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-querenzhengque:before{content:"\e600"}.icon-tishi:before{content:"\e640"}.icon-cuowu:before{content:"\e602"}.icon-jinggao:before{content:"\e62b"}*{box-sizing:border-box;margin:0;padding:0;font-weight:300}body,body ::-webkit-input-placeholder{font-family:Source Sans Pro,sans-serif;color:#fff;font-weight:300}body :-moz-placeholder,body ::-moz-placeholder{font-family:Source Sans Pro,sans-serif;color:#fff;opacity:1;font-weight:300}body :-ms-input-placeholder{font-family:Source Sans Pro,sans-serif;color:#fff;font-weight:300}a{text-decoration:none}.wrapper{background: #01a982; background: linear-gradient(to bottom right,#01a982 0,#60ae80 100%); overflow: hidden;}.bg-bubbles,.wrapper{position:absolute;left:0;width:100%;height:100%}.bg-bubbles{top:0;z-index:1}.bg-bubbles li{position:absolute;list-style:none;display:block;width:40px;height:40px;background-color:hsla(0,0%,100%,.15);bottom:-160px;animation:square 25s infinite;transition-timing-function:linear}.bg-bubbles li:nth-child(1){left:10%}.bg-bubbles li:nth-child(2){left:20%;width:80px;height:80px;animation-delay:2s;animation-duration:17s}.bg-bubbles li:nth-child(3){left:25%;animation-delay:4s}.bg-bubbles li:nth-child(4){left:40%;width:60px;height:60px;animation-duration:22s;background-color:hsla(0,0%,100%,.25)}.bg-bubbles li:nth-child(5){left:70%}.bg-bubbles li:nth-child(6){left:80%;width:120px;height:120px;animation-delay:3s;background-color:hsla(0,0%,100%,.2)}.bg-bubbles li:nth-child(7){left:32%;width:160px;height:160px;animation-delay:7s}.bg-bubbles li:nth-child(8){left:55%;width:20px;height:20px;animation-delay:15s;animation-duration:40s}.bg-bubbles li:nth-child(9){left:25%;width:10px;height:10px;animation-delay:2s;animation-duration:40s;background-color:hsla(0,0%,100%,.3)}.bg-bubbles li:nth-child(10){left:90%;width:160px;height:160px;animation-delay:11s}@keyframes square{0%{transform:translatey(0)}to{transform:translatey(-700px) rotate(600deg)}}@media (max-width:500px){.container h1{font-size:60px}form button,form input{width:500px}}.main{padding:50px 0;z-index:999;position:relative}.main h1{font-size:40px;text-align:center;color:#fff;margin-bottom:30px;text-transform:uppercase}.content{margin:0 auto;width:28%;background:#fff;border-radius:5px}p.footer{font-size:16px;text-align:center;color:#fff;font-weight:500;margin-top:30px}p.footer a{color:#55acee}p.footer a:hover{color:#000;transition:.5s all;-webkit-transition:.5s all;-moz-transition:.5s all;-o-transition:.5s all;-ms-transition:.5s all}.content-top h2{font-size:22px;color:#fff;text-align:center;background:#02a982;padding:12px 0;border-radius:5px}.content-top p{text-align:center;font-size:16px;color:#000;margin-top:15px}.content-top ul li{display:block;font-size:15px;color:#000;line-height:1.8em;padding:1em 0 1em 1em;border-bottom:1px solid #e2e0de}.content-top ul li a{color:#000;font-weight:400}.content-top ul li a i{color:#02a982;font-style:normal;display:block;margin:2px 0}.content-top ul li span{display:block;color:#999}.content-top{padding:1.5em}.content-top p a{color:#55acee;margin-left:5px}@media (max-width:1366px){.content{width:31%}}@media (max-width:1280px){.content{width:32%}}@media (max-width:1080px){.content{width:38%}.main h1{font-size:36px}.content-top h2{font-size:20px;padding:10px 0}.content-top p,.content-top ul li,p.footer{font-size:14px}}@media (max-width:800px){.main h1{font-size:34px}.content{width:46%}}@media (max-width:768px){.main{padding:90px 0}.main h1{margin-bottom:55px}p.footer{margin-top:75px}}@media (max-width:736px){.main{padding:70px 0}.main h1{margin-bottom:45px}.content{width:53%}p.footer{margin-top:50px}}@media (max-width:667px){.main h1{font-size:32px;margin-bottom:35px}.main{padding:60px 0}.content{width:57%}.content-top h2{font-size:18px}}@media (max-width:600px){.main h1{font-size:30px}.content-top{padding:1em}.content{width:62%}}@media (max-width:568px){.content{width:68%}}@media (max-width:480px){.content{width:78%}.main h1{font-size:28px}p.footer{margin-top:42px}}@media (max-width:414px){.content-top h2{font-size:16px}.content{width:85%}.main{padding:50px 0}p.footer{line-height:1.8em;margin:42px auto 0;width:85%}}@media (max-width:384px){.main h1{font-size:27px}.content,p.footer{width:90%}p.footer{margin:32px auto 0}}@media (max-width:375px){.main h1{font-size:26px;margin-bottom:25px}.main{padding:45px 0}.content,p.footer{width:92%}.content-top h2{padding:8px 0}}@media (max-width:320px){.main h1{font-size:24px;margin-bottom:30px}.content-top ul li{padding:1em 0 1em 1em;background-size:13%!important}.content-top{padding:1.2em}.content-top p,.content-top ul li,p.footer{font-size:13px}.content,p.footer{width:90%}}@media(max-width:500px){.bg-bubbles, .wrapper{height:auto;}}</style> </head> <body> <div id="all"> <div class="wrapper"> <div class="main"> <h1>BA综合发布页</h1> <div class="content"> <div class="content-top"> <h2>请 Ctrl+D 收藏本页到浏览器收藏夹</h2> <ul> <li> 授权查询 <a href="http://bamxys.kvlzv.top/query.php" target="_blank"><i>http://bamxys.kvlzv.top/query.php</i></a> </li> <li> 使用卡密 <a href="http://bamxys.kvlzv.top/auth.php" target="_blank"><i>http://bamxys.kvlzv.top//auth.php</i></a> </li> <li> 代理登录 <a href="http://bamxys.kvlzv.top/agent" target="_blank"><i>http://bamxys.kvlzv.top/admin</i></a> </li> <li> 自助购买 <a href="https://fk.jiuykj.com/shop/RXTool" target="_blank"><i>https://fk.jiuykj.com/shop/RXTool</i></a> </li> <li> BA系列插件插件下载 <a href="https://www.123912.com/s/ZFvDVv-5K8Sv" target="_blank"><i>https://www.123912.com/s/ZFvDVv-5K8Sv </li> <li> <span>近期部分国产浏览器屏蔽网址,电脑请安装<a href="https://www.google.cn/chrome/" target="_blank">chrome浏览器</a>访问,手机请安装<a href="https://www.xbext.com/" target="_blank">X浏览器</a>访问。<span> </span></span></li></ul> </div> </div> <p class="footer">© 2025 BA综合发布页. All Rights Reserved</p> </div> <ul class="bg-bubbles"> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul> </div> </div> </div> <br> <div style="display:none"><script type="text/javascript" src="https://v1.cnzz.com/z_stat.php?id=1279597563&web_id=1279597563"></script></div> </body></html> 请你给这段代码页脚加一个网站已运行
最新发布
07-29
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>CINP Mechanism Research Hypothesis</title> <script src="https://cdn.jsdelivr.net/npm/mermaid@10.0.2/dist/mermaid.min.js"></script> <style> body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%); display: flex; flex-direction: column; align-items: center; padding: 20px; color: #2c3e50; } .container { max-width: 1200px; width: 100%; background: white; border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12); overflow: hidden; margin: 20px 0; } header { background: linear-gradient(90deg, #1a2980 0%, #26d0ce 100%); color: white; padding: 25px 40px; text-align: center; } h1 { margin: 0; font-size: 2.4rem; letter-spacing: 0.5px; font-weight: 600; } .subtitle { font-size: 1.1rem; opacity: 0.9; margin-top: 8px; font-weight: 300; } .content { padding: 30px; } .diagram-container { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 25px; margin: 20px 0; min-height: 600px; display: flex; justify-content: center; align-items: center; } .mermaid { width: 100%; height: 550px; font-size: 14px; } .legend { display: flex; justify-content: center; gap: 25px; margin: 20px 0; flex-wrap: wrap; } .legend-item { display: flex; align-items: center; gap: 8px; } .legend-color { width: 20px; height: 20px; border-radius: 4px; } .key-mechanism { background-color: #e3f2fd; border-left: 4px solid #2196f3; padding: 20px; margin: 25px 0; border-radius: 0 8px 8px 0; } .key-mechanism h3 { margin-top: 0; color: #1a2980; } footer { text-align: center; padding: 20px; color: #7b8793; font-size: 0.9rem; border-top: 1px solid #e2e8f0; } @media (max-width: 768px) { .content { padding: 20px 15px; } h1 { font-size: 1.8rem; } .diagram-container { padding: 15px; min-height: 400px; } .mermaid { height: 380px; } } </style> </head> <body> <div class="container"> <header> <h1>Chemotherapy-Induced Neuropathic Pain (CINP) Research Hypothesis</h1> <div class="subtitle">Mechanism of Magnesium Sulfate Intervention in TNF-α→pNR2B-NMDA→Cellular Damage Pathway</div> </header> <div class="content"> <div class="key-mechanism"> <h3>Core Research Hypothesis</h3> <p>Magnesium sulfate exerts pre-protective effects against CINP by dual-targeting the "TNF-α → pNR2B-NMDA receptor → cellular damage" signaling axis through:</p> <ul> <li>Inhibition of TNF-α via NF-κB pathway</li> <li>Antagonism of NMDA receptors via channel blockade</li> </ul> </div> <div class="legend"> <div class="legend-item"> <div class="legend-color" style="background-color: #FFF9C4;"></div> <span>Chemotherapy Input</span> </div> <div class="legend-item"> <div class="legend-color" style="background-color: #FFCCBC;"></div> <span>Key Pathological Processes</span> </div> <div class="legend-item"> <div class="legend-color" style="background-color: #C8E6C9;"></div> <span>MgSO₄ Intervention</span> </div> <div class="legend-item"> <div class="legend-color" style="background-color: #BBDEFB;"></div> <span>Neuroprotective Outcome</span> </div> </div> <div class="diagram-container"> <div class="mermaid"> flowchart TD %% Chemotherapy Input A[Chemotherapeutic Drugs]:::chemo --> B[CINP Development\nPeripheral/Central Sensitization\nGlial Cell Activation] %% Neuroinflammation-Excitotoxicity Cycle subgraph "Neuroinflammation-Excitotoxicity Cycle" B --> C[TNF-α Release] C --> D[TNF-α binds TNFR1] D --> E[Direct Sensitization of\nNociceptive Neurons] D --> F[Fyn Kinase Activation] F --> G[NR2B Phosphorylation\n(pTyr1472)] G --> H[Enhanced NMDA\nReceptor Function] H --> I[Excessive Glutamatergic\nSignaling] I --> J[Ca²⁺ Overload] J --> K[Neuronal Apoptosis &\nAutophagy Blockade] K --> L[Irreversible\nCellular Damage] L --> B end %% MgSO4 Intervention M[MgSO₄ Intervention]:::mgso4 --> N1[Inhibits TNF-α\nvia NF-κB pathway] N1 -.-> C M --> N2[Antagonizes NMDA Receptor\nvia Channel Blockade] N2 -.-> H %% Outcomes M --> O[Pre-protective Effect\nAgainst CINP]:::outcome O --> P[Reduced Neuronal Damage\nPain Alleviation]:::outcome %% Styling classDef chemo fill:#FFF9C4,stroke:#F57F17,stroke-width:2px classDef process fill:#FFCCBC,stroke:#E64A19,stroke-width:2px classDef mgso4 fill:#C8E6C9,stroke:#2E7D32,stroke-width:2px classDef outcome fill:#BBDEFB,stroke:#1565C0,stroke-width:2px class A chemo class B,C,D,E,F,G,H,I,J,K,L process class M,N1,N2 mgso4 class O,P outcome </div> </div> </div> <footer> <p>Research Hypothesis Mechanism Diagram | CINP: Chemotherapy-Induced Neuropathic Pain</p> </footer> </div> <script> mermaid.initialize({ startOnLoad: true, theme: 'default', fontFamily: 'Segoe UI, sans-serif', flowchart: { useMaxWidth: true, curve: 'basis', nodeSpacing: 50, rankSpacing: 70 }, securityLevel: 'loose' }); </script> </body> </html>
07-22
请你帮我把这个运行成可下载的PDF:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Research Hypothesis: MgSO₄ in Chemotherapy-Induced Neuropathic Pain</title> <script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script> <style> body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f8f9fa; margin: 0; padding: 20px; display: flex; flex-direction: column; align-items: center; } .container { max-width: 1200px; width: 100%; background-color: white; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); padding: 30px; margin-top: 20px; } header { text-align: center; margin-bottom: 30px; border-bottom: 2px solid #3498db; padding-bottom: 20px; } h1 { color: #2c3e50; margin-bottom: 10px; } .subtitle { color: #7f8c8d; font-size: 1.2em; margin-top: 0; } .diagram-container { width: 100%; min-height: 500px; background-color: #f5f7fa; border-radius: 8px; padding: 20px; margin: 20px 0; } .legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px; margin: 20px 0; padding: 15px; background-color: #e8f4fc; border-radius: 8px; } .legend-item { display: flex; align-items: center; gap: 8px; font-size: 14px; } .color-box { width: 20px; height: 20px; border-radius: 4px; } .key-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 30px; } .card { background-color: #f8f9fa; border-left: 4px solid #3498db; padding: 15px; border-radius: 4px; } .card h3 { margin-top: 0; color: #2c3e50; } footer { text-align: center; margin-top: 30px; color: #7f8c8d; font-size: 0.9em; padding-top: 20px; border-top: 1px solid #ecf0f1; } @media print { body { padding: 0; margin: 0; } .container { box-shadow: none; padding: 10px; } .no-print { display: none; } } </style> </head> <body> <div class="container"> <header> <h1>Research Hypothesis: MgSO₄ in Chemotherapy-Induced Neuropathic Pain (CINP)</h1> <p class="subtitle">Mechanism of Action and Protective Effects</p> </header> <div class="diagram-container"> <div class="mermaid"> flowchart TD %% Chemotherapy Induction A[Oxaliplatin<br>Chemotherapy] --> B %% Core Mechanism Pathway subgraph B[Chemotherapy-Induced Neuropathic Pain] direction TB C[TNF-α Release] --> D[TNFR1 Activation] D --> E[Fyn Kinase Activation] E --> F[NR2B Phosphorylation<br>(pTyr1472)] F --> G[NMDA Receptor<br>Hyperactivation] G --> H[Ca²⁺ Influx] H --> I[Neuronal Apoptosis] H --> J[Autophagy Flux<br>Disruption] I --> K[Neuropathic Pain] J --> K end %% Magnesium Intervention L[MgSO₄ Intervention] -->|Inhibits NF-κB Pathway| C L -->|Blocks Ion Channel| G %% Pain Outcome K --> M((Persistent<br>Neuropathic Pain)) %% Style enhancements classDef chem fill:#f8d7da,stroke:#721c24,color:#721c24; classDef process fill:#cfe2ff,stroke:#052c65,color:#052c65; classDef effect fill:#fff3cd,stroke:#856404,color:#856404; classDef pain fill:#d1ecf1,stroke:#0c5460,color:#0c5460; classDef intervention fill:#d4edda,stroke:#155724,color:#155724; class A chem; class B process; class C,D,E,F,G process; class H,I,J effect; class K,M pain; class L intervention; </div> </div> <div class="legend"> <div class="legend-item"> <div class="color-box" style="background-color: #f8d7da;"></div> <span>Chemotherapy Induction</span> </div> <div class="legend-item"> <div class="color-box" style="background-color: #cfe2ff;"></div> <span>Core Molecular Processes</span> </div> <div class="legend-item"> <div class="color-box" style="background-color: #fff3cd;"></div> <span>Cellular Effects</span> </div> <div class="legend-item"> <div class="color-box" style="background-color: #d1ecf1;"></div> <span>Pain Outcome</span> </div> <div class="legend-item"> <div class="color-box" style="background-color: #d4edda;"></div> <span>MgSO₄ Intervention</span> </div> </div> <div class="key-points"> <div class="card"> <h3>Core Pathogenic Mechanism</h3> <p>The "TNF-α → pNR2B-NMDA → Cellular Damage" axis is central to chemotherapy-induced neuropathic pain development:</p> <ul> <li>TNF-α activates TNFR1 receptors</li> <li>Fyn kinase phosphorylates NR2B subunit (pTyr1472)</li> <li>NMDA receptor hyperfunction causes Ca²⁺ overload</li> <li>Leads to neuronal apoptosis & autophagy disruption</li> </ul> </div> <div class="card"> <h3>MgSO₄ Dual-Action Intervention</h3> <p>Magnesium sulfate provides dual protective effects:</p> <ul> <li><strong>Anti-inflammatory action:</strong> Inhibits TNF-α release via NF-κB pathway suppression</li> <li><strong>Receptor modulation:</strong> Blocks NMDA receptor ion channel as non-competitive antagonist</li> <li>Targets both arms of the pathogenic pathway</li> </ul> </div> <div class="card"> <h3>Research Implications</h3> <p>This study will validate:</p> <ul> <li>The causal relationship in the TNF-α/pNR2B pathway</li> <li>MgSO₄ efficacy in preventing CINP development</li> <li>Downstream cellular protection mechanisms</li> <li>Potential for clinical translation</li> </ul> </div> </div> </div> <footer class="no-print"> <p>This diagram illustrates the proposed mechanism of chemotherapy-induced neuropathic pain and the protective effects of magnesium sulfate</p> <p>To save as PDF: Use browser's Print function and select "Save as PDF"</p> </footer> <script> mermaid.initialize({ startOnLoad: true, theme: 'default', flowchart: { useMaxWidth: true, curve: 'linear', nodeSpacing: 50, rankSpacing: 70 }, securityLevel: 'loose' }); </script> </body> </html>
07-22
<script setup lang="ts"> import { ref } from 'vue' const searchText = ref('') const isSearching = ref(false) const results = ref<string[]>([]) const handleSearch = () => { if (!searchText.value) { isSearching.value = false return } else { isSearching.value = true setTimeout(() => { results.value = Array.from({ length: 10 }, (_, i) => `结果 ${i + 1}: ${searchText.value}`) }, 500) } } </script> <template> <div class="container" :class="{ 'search-active': isSearching }"> <div class="search-box"> <input v-model="searchText" type="text" placeholder="输入搜索内容" @keyup.enter="handleSearch"> <button @click="handleSearch"> 搜索 </button> </div> <transition name="list"> <ul v-if="isSearching" class="result-list"> <li v-for="(item, index) in results" :key="index"> {{ item }} </li> </ul> </transition> </div> </template> <style> .container { height: 100vh; display: flex; flex-direction: column; align-items: center; transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1); } .container:not(.search-active) { justify-content: center; } .search-active { padding-top: 50px; } .search-box { display: flex; transition: transform 0.3s ease; } input { width: 300px; padding: 12px 20px; border-radius: 25px; font-size: 16px; } button { padding: 12px 25px; background: #42b883; border-radius: 25px; color: white; cursor: pointer; } .result-list { width: 500px; max-height: 60vh; overflow-y: auto; margin-top: 30px; padding: 0; list-style: none; } /* 过渡动画 */ .list-enter-active, .list-leave-active { transition: all 0.5s ease; } .list-enter-from, .list-leave-to { opacity: 0; transform: translateY(-20px); } </style> 现在过度动画很不流畅尤其是搜索框回到初始状态的
04-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值