<!DOCTYPE html>
<!-- saved from url=(0019)https://codepen.io/ -->
<html lang="en" class="pc"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="csrf-param" content="authenticity_token">
<meta name="csrf-token" content="A03ENKfR4rmMRF8hsIHXF9YodifCqgBHrZNFtEG0AR+B7XI9pseZJToJ0kl68sXCeoSgEgnoSdoIvame0pDupg==">
<title _msthash="149916" _msttexthash="136317077">CodePen:在线代码编辑器和前端 Web 开发人员社区</title>
<meta name="description" content="Build, share, and learn JavaScript, CSS, and HTML with our online code editor.">
<meta name="keywords" content="javascript, css, editor, code, community, social, frontend, developer, designer, deploy, test, demo, spa, single, page, application, web, html, modern, ide, browser, pen, codepen">
<link rel="dns-prefetch" href="https://fast.appcues.com/">
<link rel="dns-prefetch" href="https://fonts.googleapis.com/">
<link rel="stylesheet" media="all" href="./CodePen:在线代码编辑器和前端 Web 开发人员社区_files/global-287e19e0385dcda82839437227412a58ee4d27c64c582021f54dcac3cc8b2d9c.css">
<link rel="stylesheet" media="all" href="./CodePen:在线代码编辑器和前端 Web 开发人员社区_files/page-f140b10b168429b7c38af50f9c4aa86d0f041e8b099ad1cafc119805c7b61ed0.css">
<link rel="stylesheet" media="screen" href="./CodePen:在线代码编辑器和前端 Web 开发人员社区_files/everypage-33b8a4ed.css">
<link rel="alternate" type="application/rss+xml" title="RSS Feed for CodePen Editor's Picks" href="https://codepen.io/picks/feed">
<meta property="og:image" content="https://cpwebassets.codepen.io/assets/social/facebook-default-05cf522ae1d4c215ae0f09d866d97413a2204b6c9339c6e7a1b96ab1d4a7340f.png">
<meta property="og:title" content="CodePen">
<meta property="og:description" content="An online code editor, learning environment, and community for front-end web development using HTML, CSS and JavaScript code snippets, projects, and web applications.">
<meta name="description" content="An online code editor, learning environment, and community for front-end web development using HTML, CSS and JavaScript code snippets, projects, and web applications.">
<link rel="apple-touch-icon" href="https://cpwebassets.codepen.io/assets/favicon/favicon-touch-de50acbf5d634ec6791894eba4ba9cf490f709b3d742597c6fc4b734e6492a5a.png">
<link rel="apple-touch-icon" type="image/png" href="https://cpwebassets.codepen.io/assets/favicon/apple-touch-icon-5ae1a0698dcc2402e9712f7d01ed509a57814f994c660df9f7a952f3060705ee.png">
<meta name="apple-mobile-web-app-title" content="CodePen">
<link rel="shortcut icon" type="image/x-icon" href="https://cpwebassets.codepen.io/assets/favicon/favicon-aec34940fbc1a6e787974dcd360f2c6b63348d4b1f4e06c77743096d55480f33.ico">
<link rel="mask-icon" type="image/x-icon" href="https://cpwebassets.codepen.io/assets/favicon/logo-pin-8f3771b1072e3c38bd662872f6b673a722f4b3ca2421637d5596661b4e2132cc.svg" color="#111">
<meta name="monetization" content="$ilp.uphold.com/biyqg2MkQKbe">
<script nonce="">
/* Firefox needs this to prevent FOUT */
</script>
<style id="_goober"> @keyframes go487993996{from{transform:scale(0) rotate(45deg);opacity:0;}to{transform:scale(1) rotate(45deg);opacity:1;}}@keyframes go1747222846{from{transform:scale(0);opacity:0;}to{transform:scale(1);opacity:1;}}@keyframes go2652833988{from{transform:scale(0) rotate(90deg);opacity:0;}to{transform:scale(1) rotate(90deg);opacity:1;}}@keyframes go1268368563{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}@keyframes go3344466522{0%{height:0;width:0;opacity:0;}40%{height:0;width:6px;opacity:1;}100%{opacity:1;height:10px;}}@keyframes go2190974446{from{transform:scale(0.6);opacity:0.4;}to{transform:scale(1);opacity:1;}}</style><link rel="stylesheet" type="text/css" href="./CodePen:在线代码编辑器和前端 Web 开发人员社区_files/Homepage-Anon-a160db85.chunk.css"><script charset="utf-8" src="./CodePen:在线代码编辑器和前端 Web 开发人员社区_files/Homepage-Anon-f535cfc269e51ef314f9.chunk.js.下载"></script><script id="_carbonads_projs" type="text/javascript" src="./CodePen:在线代码编辑器和前端 Web 开发人员社区_files/CK7IVK7U.json"></script></head>
<body class=" not-team logged-out" data-sidebar-collapsed="false" data-mobile-nav-open="false">
<div id="react-page"><header class="main-sidebar" style=""><div class="Sidebar_root-3sokO"><h1 class="Logo_root-28eiX" data-component="Logo" data-test-id="logo"><a href="https://codepen.io/" class="Logo_small-2rYbf" _msthidden="1"><svg viewBox="0 0 100 100"><path d="M100 34.2c-.4-2.6-3.3-4-5.3-5.3-3.6-2.4-7.1-4.7-10.7-7.1-8.5-5.7-17.1-11.4-25.6-17.1-2-1.3-4-2.7-6-4-1.4-1-3.3-1-4.8 0-5.7 3.8-11.5 7.7-17.2 11.5L5.2 29C3 30.4.1 31.8 0 34.8c-.1 3.3 0 6.7 0 10v16c0 2.9-.6 6.3 2.1 8.1 6.4 4.4 12.9 8.6 19.4 12.9 8 5.3 16 10.7 24 16 2.2 1.5 4.4 3.1 7.1 1.3 2.3-1.5 4.5-3 6.8-4.5 8.9-5.9 17.8-11.9 26.7-17.8l9.9-6.6c.6-.4 1.3-.8 1.9-1.3 1.4-1 2-2.4 2-4.1V37.3c.1-1.1.2-2.1.1-3.1 0-.1 0 .2 0 0zM54.3 12.3L88 34.8 73 44.9 54.3 32.4V12.3zm-8.6 0v20L27.1 44.8 12 34.8l33.7-22.5zM8.6 42.8L19.3 50 8.6 57.2V42.8zm37.1 44.9L12 65.2l15-10.1 18.6 12.5v20.1zM50 60.2L34.8 50 50 39.8 65.2 50 50 60.2zm4.3 27.5v-20l18.6-12.5 15 10.1-33.6 22.4zm37.1-30.5L80.7 50l10.8-7.2-.1 14.4z"></path></svg><span class="screen-reader-text" _msthash="1276184" _msttexthash="167999" _msthidden="1">CodePen Home</span></a><a href="https://codepen.io/" class="Logo_large-3wkfp"><svg viewBox="0 0 138 26" fill="none" stroke="#fff" stroke-width="2.3" stroke-linecap="round" stroke-linejoin="round" title="CodePen"><path d="M15 8a7 7 0 100 10m7-8.7L33 2l11 7.3v7.4L33 24l-11-7.3zm0 0l11 7.4 11-7.4m0 7.4L33 9.3l-11 7.4M33 2v7.3m0 7.4V24M52 6h5a7 7 0 010 14h-5zm28 0h-9v14h9m-9-7h6m11 1h6a4 4 0 000-8h-6v14m26-14h-9v14h9m-9-7h6m11 7V6l11 14V6"></path></svg><span class="screen-reader-text" _msthash="1276185" _msttexthash="167999">CodePen Home</span></a></h1><div class="SidebarToggle_toggleDesktop-2sia3"><button class="SidebarToggle_toggle-1O9LZ invisible-button" aria-expanded="true" data-collapsed="false" data-test-id="collapse-button" title="Toggle Navigation"><div class="SidebarToggle_icon-3UUpw" aria-hidden="true"><span></span><svg viewBox="-122.9 121.1 105.9 61.9" width="20" height="20"><path d="M-63.2 180.3l43.5-43.5c1.7-1.7 2.7-4 2.7-6.5s-1-4.8-2.7-6.5c-1.7-1.7-4-2.7-6.5-2.7s-4.8 1-6.5 2.7L-69.9 161l-37.2-37.2c-1.7-1.7-4-2.7-6.5-2.7s-4.8 1-6.5 2.6c-1.9 1.8-2.8 4.2-2.8 6.6 0 2.3.9 4.6 2.6 6.5 11.4 11.5 41 41.2 43 43.3l.2.2c3.6 3.6 10.3 3.6 13.9 0z"></path></svg></div><span class="screen-reader-text" _msthash="1673022" _msttexthash="442832">Navigation Menu Toggle</span></button><div class="SidebarToggle_openBar-3GqUx" data-collapsed="false"></div></div><div class="SidebarToggle_toggleMobile-3DAu_" _msthidden="1"><button class="SidebarToggle_toggle-1O9LZ invisible-button" aria-expanded="false" data-collapsed="true" data-test-id="collapse-button" title="Toggle Navigation" _msthidden="1"><div class="SidebarToggle_icon-3UUpw" aria-hidden="true"><span></span><svg viewBox="-122.9 121.1 105.9 61.9" width="20" height="20"><path d="M-63.2 180.3l43.5-43.5c1.7-1.7 2.7-4 2.7-6.5s-1-4.8-2.7-6.5c-1.7-1.7-4-2.7-6.5-2.7s-4.8 1-6.5 2.7L-69.9 161l-37.2-37.2c-1.7-1.7-4-2.7-6.5-2.7s-4.8 1-6.5 2.6c-1.9 1.8-2.8 4.2-2.8 6.6 0 2.3.9 4.6 2.6 6.5 11.4 11.5 41 41.2 43 43.3l.2.2c3.6 3.6 10.3 3.6 13.9 0z"></path></svg></div><span class="screen-reader-text" _msthash="1673023" _msttexthash="442832" _msthidden="1">Navigation Menu Toggle</span></button></div><nav class="navigation-wrap Sidebar_navigationWrap-9Bxnd" role="navigation"><div class="SidebarCreate_root-v_Ukv"><h2 class="SidebarHeading_root-3WoMs SidebarCreate_anonHeading-1rt9Z" _msthash="1351662" _msttexthash="43536038">试试我们的在线编辑器</h2><a href="https://codepen.io/pen/" class="SidebarCreate_anonButton-1O0KD"><span _msthash="1706406" _msttexthash="12
评论0