跳转到内容
代码片段·免费

HTML 与 CSS 代码片段

8 个 HTML 代码片段(页面地标、Open Graph 标签、picture、dialog、带表头的表格)和 12 个 CSS 代码片段(重置样式、grid 布局、clamp、深色模式变量、减少动效、容器查询)。

免费安装。

如果你的 Android 设备上装了 PocketCode,这会在应用里打开此页面。

预览

20 个中的 5 个

Page layout with landmarkslayout

Header, nav, main and footer for a page body

<header>
  <nav aria-label="${1:Main}">
    <a href="/">${2:Home}</a>
  </nav>
</header>
<main>
  $0
</main>
<footer>
  <p>${3:Footer text}</p>
</footer>

Social preview meta tagsogmeta

Description and Open Graph tags for link previews

<meta name="description" content="${1:Page description}">
<meta property="og:title" content="${2:Page title}">
<meta property="og:description" content="${1:Page description}">
<meta property="og:image" content="${3:https://example.com/cover.png}">
<meta name="twitter:card" content="summary_large_image">

Responsive imagepicture

WebP with a JPEG fallback, fixed size and lazy loading

<picture>
  <source srcset="${1:image.webp}" type="image/webp">
  <img src="${2:image.jpg}" alt="${3:Description}" width="${4:800}" height="${5:600}" loading="lazy">
</picture>

Input with a labellabeled

Labelled input with autocomplete and required

<label for="${1:email}">${2:Email}</label>
<input id="${1:email}" name="${1:email}" type="${3:email}" autocomplete="${4:email}" required>

Native dialogdlg

dialog element whose buttons close it with a return value

<dialog id="${1:confirm}">
  <form method="dialog">
    <p>${2:Are you sure?}</p>
    <button value="cancel">${3:Cancel}</button>
    <button value="ok">${4:OK}</button>
  </form>
</dialog>

1.0.0 的变更

首个版本。

相关