CINXE.COM

CSS Generated Content Module Level 3

<!doctype html><html lang="en"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"> <title>CSS Generated Content Module Level 3</title> <meta content="ED" name="w3c-status"> <link href="https://www.w3.org/StyleSheets/TR/2021/W3C-ED" rel="stylesheet"> <meta content="Bikeshed version 742f3d674, updated Mon Nov 4 14:56:54 2024 -0800" name="generator"> <link href="https://www.w3.org/TR/css-content-3/" rel="canonical"> <link href="https://drafts.csswg.org/csslogo.ico" rel="icon"> <meta content="1f4e5de6538eeaed2378d127300a62f95146562f" name="revision"> <meta content="dark light" name="color-scheme"> <link href="https://www.w3.org/StyleSheets/TR/2021/dark.css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css"> <style>/* Boilerplate: style-autolinks */ .css.css, .property.property, .descriptor.descriptor { color: var(--a-normal-text); font-size: inherit; font-family: inherit; } .css::before, .property::before, .descriptor::before { content: "‘"; } .css::after, .property::after, .descriptor::after { content: "’"; } .property, .descriptor { /* Don't wrap property and descriptor names */ white-space: nowrap; } .type { /* CSS value <type> */ font-style: italic; } pre .property::before, pre .property::after { content: ""; } [data-link-type="property"]::before, [data-link-type="propdesc"]::before, [data-link-type="descriptor"]::before, [data-link-type="value"]::before, [data-link-type="function"]::before, [data-link-type="at-rule"]::before, [data-link-type="selector"]::before, [data-link-type="maybe"]::before { content: "‘"; } [data-link-type="property"]::after, [data-link-type="propdesc"]::after, [data-link-type="descriptor"]::after, [data-link-type="value"]::after, [data-link-type="function"]::after, [data-link-type="at-rule"]::after, [data-link-type="selector"]::after, [data-link-type="maybe"]::after { content: "’"; } [data-link-type].production::before, [data-link-type].production::after, .prod [data-link-type]::before, .prod [data-link-type]::after { content: ""; } [data-link-type=element], [data-link-type=element-attr] { font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace; font-size: .9em; } [data-link-type=element]::before { content: "<" } [data-link-type=element]::after { content: ">" } [data-link-type=biblio] { white-space: pre; } @media (prefers-color-scheme: dark) { :root { --selflink-text: black; --selflink-bg: silver; --selflink-hover-text: white; } } </style> <style>/* Boilerplate: style-colors */ /* Any --*-text not paired with a --*-bg is assumed to have a transparent bg */ :root { color-scheme: light dark; --text: black; --bg: white; --unofficial-watermark: url(https://www.w3.org/StyleSheets/TR/2016/logos/UD-watermark); --logo-bg: #1a5e9a; --logo-active-bg: #c00; --logo-text: white; --tocnav-normal-text: #707070; --tocnav-normal-bg: var(--bg); --tocnav-hover-text: var(--tocnav-normal-text); --tocnav-hover-bg: #f8f8f8; --tocnav-active-text: #c00; --tocnav-active-bg: var(--tocnav-normal-bg); --tocsidebar-text: var(--text); --tocsidebar-bg: #f7f8f9; --tocsidebar-shadow: rgba(0,0,0,.1); --tocsidebar-heading-text: hsla(203,20%,40%,.7); --toclink-text: var(--text); --toclink-underline: #3980b5; --toclink-visited-text: var(--toclink-text); --toclink-visited-underline: #054572; --heading-text: #005a9c; --hr-text: var(--text); --algo-border: #def; --del-text: red; --del-bg: transparent; --ins-text: #080; --ins-bg: transparent; --a-normal-text: #034575; --a-normal-underline: #bbb; --a-visited-text: var(--a-normal-text); --a-visited-underline: #707070; --a-hover-bg: rgba(75%, 75%, 75%, .25); --a-active-text: #c00; --a-active-underline: #c00; --blockquote-border: silver; --blockquote-bg: transparent; --blockquote-text: currentcolor; --issue-border: #e05252; --issue-bg: #fbe9e9; --issue-text: var(--text); --issueheading-text: #831616; --example-border: #e0cb52; --example-bg: #fcfaee; --example-text: var(--text); --exampleheading-text: #574b0f; --note-border: #52e052; --note-bg: #e9fbe9; --note-text: var(--text); --noteheading-text: hsl(120, 70%, 30%); --notesummary-underline: silver; --assertion-border: #aaa; --assertion-bg: #eee; --assertion-text: black; --advisement-border: orange; --advisement-bg: #fec; --advisement-text: var(--text); --advisementheading-text: #b35f00; --warning-border: red; --warning-bg: hsla(40,100%,50%,0.95); --warning-text: var(--text); --amendment-border: #330099; --amendment-bg: #F5F0FF; --amendment-text: var(--text); --amendmentheading-text: #220066; --def-border: #8ccbf2; --def-bg: #def; --def-text: var(--text); --defrow-border: #bbd7e9; --datacell-border: silver; --indexinfo-text: #707070; --indextable-hover-text: black; --indextable-hover-bg: #f7f8f9; --outdatedspec-bg: rgba(0, 0, 0, .5); --outdatedspec-text: black; --outdated-bg: maroon; --outdated-text: white; --outdated-shadow: red; --editedrec-bg: darkorange; } @media (prefers-color-scheme: dark) { :root { --text: #ddd; --bg: black; --unofficial-watermark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cg fill='%23100808' transform='translate(200 200) rotate(-45) translate(-200 -200)' stroke='%23100808' stroke-width='3'%3E%3Ctext x='50%25' y='220' style='font: bold 70px sans-serif; text-anchor: middle; letter-spacing: 6px;'%3EUNOFFICIAL%3C/text%3E%3Ctext x='50%25' y='305' style='font: bold 70px sans-serif; text-anchor: middle; letter-spacing: 6px;'%3EDRAFT%3C/text%3E%3C/g%3E%3C/svg%3E"); --logo-bg: #1a5e9a; --logo-active-bg: #c00; --logo-text: white; --tocnav-normal-text: #999; --tocnav-normal-bg: var(--bg); --tocnav-hover-text: var(--tocnav-normal-text); --tocnav-hover-bg: #080808; --tocnav-active-text: #f44; --tocnav-active-bg: var(--tocnav-normal-bg); --tocsidebar-text: var(--text); --tocsidebar-bg: #080808; --tocsidebar-shadow: rgba(255,255,255,.1); --tocsidebar-heading-text: hsla(203,20%,40%,.7); --toclink-text: var(--text); --toclink-underline: #6af; --toclink-visited-text: var(--toclink-text); --toclink-visited-underline: #054572; --heading-text: #8af; --hr-text: var(--text); --algo-border: #456; --del-text: #f44; --del-bg: transparent; --ins-text: #4a4; --ins-bg: transparent; --a-normal-text: #6af; --a-normal-underline: #555; --a-visited-text: var(--a-normal-text); --a-visited-underline: var(--a-normal-underline); --a-hover-bg: rgba(25%, 25%, 25%, .2); --a-active-text: #f44; --a-active-underline: var(--a-active-text); --borderedblock-bg: rgba(255, 255, 255, .05); --blockquote-border: silver; --blockquote-bg: var(--borderedblock-bg); --blockquote-text: currentcolor; --issue-border: #e05252; --issue-bg: var(--borderedblock-bg); --issue-text: var(--text); --issueheading-text: hsl(0deg, 70%, 70%); --example-border: hsl(50deg, 90%, 60%); --example-bg: var(--borderedblock-bg); --example-text: var(--text); --exampleheading-text: hsl(50deg, 70%, 70%); --note-border: hsl(120deg, 100%, 35%); --note-bg: var(--borderedblock-bg); --note-text: var(--text); --noteheading-text: hsl(120, 70%, 70%); --notesummary-underline: silver; --assertion-border: #444; --assertion-bg: var(--borderedblock-bg); --assertion-text: var(--text); --advisement-border: orange; --advisement-bg: #222218; --advisement-text: var(--text); --advisementheading-text: #f84; --warning-border: red; --warning-bg: hsla(40,100%,20%,0.95); --warning-text: var(--text); --amendment-border: #330099; --amendment-bg: #080010; --amendment-text: var(--text); --amendmentheading-text: #cc00ff; --def-border: #8ccbf2; --def-bg: #080818; --def-text: var(--text); --defrow-border: #136; --datacell-border: silver; --indexinfo-text: #aaa; --indextable-hover-text: var(--text); --indextable-hover-bg: #181818; --outdatedspec-bg: rgba(255, 255, 255, .5); --outdatedspec-text: black; --outdated-bg: maroon; --outdated-text: white; --outdated-shadow: red; --editedrec-bg: darkorange; } /* In case a transparent-bg image doesn't expect to be on a dark bg, which is quite common in practice... */ img { background: white; } } </style> <style>/* Boilerplate: style-counters */ body { counter-reset: example figure issue; } .issue { counter-increment: issue; } .issue:not(.no-marker)::before { content: "Issue " counter(issue); } .example { counter-increment: example; } .example:not(.no-marker)::before { content: "Example " counter(example); } .invalid.example:not(.no-marker)::before, .illegal.example:not(.no-marker)::before { content: "Invalid Example" counter(example); } figcaption { counter-increment: figure; } figcaption:not(.no-marker)::before { content: "Figure " counter(figure) " "; } </style> <style>/* Boilerplate: style-dfn-panel */ :root { --dfnpanel-bg: #ddd; --dfnpanel-text: var(--text); --dfnpanel-target-bg: #ffc; --dfnpanel-target-outline: orange; } @media (prefers-color-scheme: dark) { :root { --dfnpanel-bg: #222; --dfnpanel-text: var(--text); --dfnpanel-target-bg: #333; --dfnpanel-target-outline: silver; } } .dfn-panel { position: absolute; z-index: 35; width: 20em; width: 300px; height: auto; max-height: 500px; overflow: auto; padding: 0.5em 0.75em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: var(--dfnpanel-bg); color: var(--dfnpanel-text); border: outset 0.2em; white-space: normal; /* in case it's moved into a pre */ } .dfn-panel:not(.on) { display: none; } .dfn-panel * { margin: 0; padding: 0; text-indent: 0; } .dfn-panel > b { display: block; } .dfn-panel a { color: var(--dfnpanel-text); } .dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; } .dfn-panel a:focus { outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color; } .dfn-panel > b + b { margin-top: 0.25em; } .dfn-panel ul { padding: 0 0 0 1em; list-style: none; } .dfn-panel li a { max-width: calc(300px - 1.5em - 1em); overflow: hidden; text-overflow: ellipsis; } .dfn-panel.activated { display: inline-block; position: fixed; left: 8px; bottom: 2em; margin: 0 auto; max-width: calc(100vw - 1.5em - .4em - .5em); max-height: 30vh; transition: left 1s ease-out, bottom 1s ease-out; } .dfn-panel .link-item:hover { text-decoration: underline; } .dfn-panel .link-item .copy-icon { opacity: 0; } .dfn-panel .link-item:hover .copy-icon, .dfn-panel .link-item .copy-icon:focus { opacity: 1; } .dfn-panel .copy-icon { display: inline-block; margin-right: 0.5em; width: 0.85em; height: 1em; border-radius: 3px; background-color: #ccc; cursor: pointer; } .dfn-panel .copy-icon .icon { width: 100%; height: 100%; background-color: #fff; display: flex; justify-content: center; align-items: center; position: relative; } .dfn-panel .copy-icon .icon::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 1px solid black; background-color: #ccc; opacity: 0.25; transform: translate(3px, -3px); } .dfn-panel .copy-icon:active .icon::before { opacity: 1; } .dfn-paneled[role="button"] { cursor: help; } .highlighted { animation: target-fade 3s; } @keyframes target-fade { from { background-color: var(--dfnpanel-target-bg); outline: 5px solid var(--dfnpanel-target-outline); } to { color: var(--a-normal-text); background-color: transparent; outline: transparent; } } </style> <style>/* Boilerplate: style-issues */ a[href].issue-return { float: right; float: inline-end; color: var(--issueheading-text); font-weight: bold; text-decoration: none; } </style> <style>/* Boilerplate: style-md-lists */ /* This is a weird hack for me not yet following the commonmark spec regarding paragraph and lists. */ [data-md] > :first-child { margin-top: 0; } [data-md] > :last-child { margin-bottom: 0; } </style> <style>/* Boilerplate: style-mdn-anno */ :root { --mdn-bg: #EEE; --mdn-shadow: #999; --mdn-nosupport-text: #ccc; --mdn-pass: green; --mdn-fail: red; } @media (prefers-color-scheme: dark) { :root { --mdn-bg: #222; --mdn-shadow: #444; --mdn-nosupport-text: #666; --mdn-pass: #690; --mdn-fail: #d22; } } .mdn-anno { background: var(--mdn-bg, #EEE); border-radius: .25em; box-shadow: 0 0 3px var(--mdn-shadow, #999); color: var(--text, black); font: 1em sans-serif; hyphens: none; max-width: min-content; overflow: hidden; padding: 0.2em; position: absolute; right: 0.3em; top: auto; white-space: nowrap; word-wrap: normal; z-index: 8; } .mdn-anno.unpositioned { display: none; } .mdn-anno.overlapping-main { opacity: .2; transition: opacity .1s; } .mdn-anno[open] { opacity: 1; z-index: 9; min-width: 9em; } .mdn-anno:hover { opacity: 1; outline: var(--text, black) 1px solid; } .mdn-anno > summary { font-weight: normal; text-align: right; cursor: pointer; display: block; } .mdn-anno > summary > .less-than-two-engines-flag { color: var(--mdn-fail); padding-right: 2px; } .mdn-anno > summary > .all-engines-flag { color: var(--mdn-pass); padding-right: 2px; } .mdn-anno > summary > span { color: #fff; background-color: #000; font-weight: normal; font-family: zillaslab, Palatino, "Palatino Linotype", serif; padding: 2px 3px 0px 3px; line-height: 1.3em; vertical-align: top; } .mdn-anno > .feature { margin-top: 20px; } .mdn-anno > .feature:not(:first-of-type) { border-top: 1px solid #999; margin-top: 6px; padding-top: 2px; } .mdn-anno > .feature > .less-than-two-engines-text { color: var(--mdn-fail); } .mdn-anno > .feature > .all-engines-text { color: var(--mdn-pass); } .mdn-anno > .feature > p { font-size: .75em; margin-top: 6px; margin-bottom: 0; } .mdn-anno > .feature > p + p { margin-top: 3px; } .mdn-anno > .feature > .support { display: block; font-size: 0.6em; margin: 0; padding: 0; margin-top: 2px; } .mdn-anno > .feature > .support + div { padding-top: 0.5em; } .mdn-anno > .feature > .support > hr { display: block; border: none; border-top: 1px dotted #999; padding: 3px 0px 0px 0px; margin: 2px 3px 0px 3px; } .mdn-anno > .feature > .support > hr::before { content: ""; } .mdn-anno > .feature > .support > span { padding: 0.2em 0; display: block; display: table; } .mdn-anno > .feature > .support > span.no { color: var(--mdn-nosupport-text); filter: grayscale(100%); } .mdn-anno > .feature > .support > span.no::before { opacity: 0.5; } .mdn-anno > .feature > .support > span:first-of-type { padding-top: 0.5em; } .mdn-anno > .feature > .support > span > span { padding: 0 0.5em; display: table-cell; } .mdn-anno > .feature > .support > span > span:first-child { width: 100%; } .mdn-anno > .feature > .support > span > span:last-child { width: 100%; white-space: pre; padding: 0; } .mdn-anno > .feature > .support > span::before { content: ' '; display: table-cell; min-width: 1.5em; height: 1.5em; background: no-repeat center center; background-size: contain; text-align: right; font-size: 0.75em; font-weight: bold; } .mdn-anno > .feature > .support > .chrome_android::before { background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg); } .mdn-anno > .feature > .support > .firefox_android::before { background-image: url(https://resources.whatwg.org/browser-logos/firefox.png); } .mdn-anno > .feature > .support > .chrome::before { background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg); } .mdn-anno > .feature > .support > .edge_blink::before { background-image: url(https://resources.whatwg.org/browser-logos/edge.svg); } .mdn-anno > .feature > .support > .edge::before { background-image: url(https://resources.whatwg.org/browser-logos/edge_legacy.svg); } .mdn-anno > .feature > .support > .firefox::before { background-image: url(https://resources.whatwg.org/browser-logos/firefox.png); } .mdn-anno > .feature > .support > .ie::before { background-image: url(https://resources.whatwg.org/browser-logos/ie.png); } .mdn-anno > .feature > .support > .safari_ios::before { background-image: url(https://resources.whatwg.org/browser-logos/safari-ios.svg); } .mdn-anno > .feature > .support > .nodejs::before { background-image: url(https://nodejs.org/static/images/favicons/favicon.ico); } .mdn-anno > .feature > .support > .opera_android::before { background-image: url(https://resources.whatwg.org/browser-logos/opera.svg); } .mdn-anno > .feature > .support > .opera::before { background-image: url(https://resources.whatwg.org/browser-logos/opera.svg); } .mdn-anno > .feature > .support > .safari::before { background-image: url(https://resources.whatwg.org/browser-logos/safari.png); } .mdn-anno > .feature > .support > .samsunginternet_android::before { background-image: url(https://resources.whatwg.org/browser-logos/samsung.svg); } .mdn-anno > .feature > .support > .webview_android::before { background-image: url(https://resources.whatwg.org/browser-logos/android-webview.png); } .name-slug-mismatch { color: red; } .caniuse-status:hover { z-index: 9; } /* dt, li, .issue, .note, and .example are "position: relative", so to put annotation at right margin, must move to right of containing block */; .h-entry:not(.status-LS) dt > .mdn-anno, .h-entry:not(.status-LS) li > .mdn-anno, .h-entry:not(.status-LS) .issue > .mdn-anno, .h-entry:not(.status-LS) .note > .mdn-anno, .h-entry:not(.status-LS) .example > .mdn-anno { right: -6.7em; } .h-entry p + .mdn-anno { margin-top: 0; } h2 + .mdn-anno.after { margin: -48px 0 0 0; } h3 + .mdn-anno.after { margin: -46px 0 0 0; } h4 + .mdn-anno.after { margin: -42px 0 0 0; } h5 + .mdn-anno.after { margin: -40px 0 0 0; } h6 + .mdn-anno.after { margin: -40px 0 0 0; } </style> <style>/* Boilerplate: style-ref-hints */ :root { --ref-hint-bg: #ddd; --ref-hint-text: var(--text); } @media (prefers-color-scheme: dark) { :root { --ref-hint-bg: #222; --ref-hint-text: var(--text); } } .ref-hint { display: inline-block; position: absolute; z-index: 35; width: 20em; width: 300px; height: auto; max-height: 500px; overflow: auto; padding: 0.5em 0.5em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: var(--ref-hint-bg); color: var(--ref-hint-text); border: outset 0.2em; white-space: normal; /* in case it's moved into a pre */ } .ref-hint * { margin: 0; padding: 0; text-indent: 0; } .ref-hint ul { padding: 0 0 0 1em; list-style: none; } </style> <style>/* Boilerplate: style-selflinks */ :root { --selflink-text: white; --selflink-bg: gray; --selflink-hover-text: black; } .heading, .issue, .note, .example, li, dt { position: relative; } a.self-link { position: absolute; top: 0; left: calc(-1 * (3.5rem - 26px)); width: calc(3.5rem - 26px); height: 2em; text-align: center; border: none; transition: opacity .2s; opacity: .5; } a.self-link:hover { opacity: 1; } .heading > a.self-link { font-size: 83%; } .example > a.self-link, .note > a.self-link, .issue > a.self-link { /* These blocks are overflow:auto, so positioning outside doesn't work. */ left: auto; right: 0; } li > a.self-link { left: calc(-1 * (3.5rem - 26px) - 2em); } dfn > a.self-link { top: auto; left: auto; opacity: 0; width: 1.5em; height: 1.5em; background: var(--selflink-bg); color: var(--selflink-text); font-style: normal; transition: opacity .2s, background-color .2s, color .2s; } dfn:hover > a.self-link { opacity: 1; } dfn > a.self-link:hover { color: var(--selflink-hover-text); } a.self-link::before { content: "¶"; } .heading > a.self-link::before { content: "§"; } dfn > a.self-link::before { content: "#"; } </style> <style>/* Boilerplate: style-syntax-highlighting */ code.highlight { padding: .1em; border-radius: .3em; } pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; } .highlight:not(.idl) { background: rgba(0, 0, 0, .03); } c-[a] { color: #990055 } /* Keyword.Declaration */ c-[b] { color: #990055 } /* Keyword.Type */ c-[c] { color: #708090 } /* Comment */ c-[d] { color: #708090 } /* Comment.Multiline */ c-[e] { color: #0077aa } /* Name.Attribute */ c-[f] { color: #669900 } /* Name.Tag */ c-[g] { color: #222222 } /* Name.Variable */ c-[k] { color: #990055 } /* Keyword */ c-[l] { color: #000000 } /* Literal */ c-[m] { color: #000000 } /* Literal.Number */ c-[n] { color: #0077aa } /* Name */ c-[o] { color: #999999 } /* Operator */ c-[p] { color: #999999 } /* Punctuation */ c-[s] { color: #a67f59 } /* Literal.String */ c-[t] { color: #a67f59 } /* Literal.String.Single */ c-[u] { color: #a67f59 } /* Literal.String.Double */ c-[cp] { color: #708090 } /* Comment.Preproc */ c-[c1] { color: #708090 } /* Comment.Single */ c-[cs] { color: #708090 } /* Comment.Special */ c-[kc] { color: #990055 } /* Keyword.Constant */ c-[kn] { color: #990055 } /* Keyword.Namespace */ c-[kp] { color: #990055 } /* Keyword.Pseudo */ c-[kr] { color: #990055 } /* Keyword.Reserved */ c-[ld] { color: #000000 } /* Literal.Date */ c-[nc] { color: #0077aa } /* Name.Class */ c-[no] { color: #0077aa } /* Name.Constant */ c-[nd] { color: #0077aa } /* Name.Decorator */ c-[ni] { color: #0077aa } /* Name.Entity */ c-[ne] { color: #0077aa } /* Name.Exception */ c-[nf] { color: #0077aa } /* Name.Function */ c-[nl] { color: #0077aa } /* Name.Label */ c-[nn] { color: #0077aa } /* Name.Namespace */ c-[py] { color: #0077aa } /* Name.Property */ c-[ow] { color: #999999 } /* Operator.Word */ c-[mb] { color: #000000 } /* Literal.Number.Bin */ c-[mf] { color: #000000 } /* Literal.Number.Float */ c-[mh] { color: #000000 } /* Literal.Number.Hex */ c-[mi] { color: #000000 } /* Literal.Number.Integer */ c-[mo] { color: #000000 } /* Literal.Number.Oct */ c-[sb] { color: #a67f59 } /* Literal.String.Backtick */ c-[sc] { color: #a67f59 } /* Literal.String.Char */ c-[sd] { color: #a67f59 } /* Literal.String.Doc */ c-[se] { color: #a67f59 } /* Literal.String.Escape */ c-[sh] { color: #a67f59 } /* Literal.String.Heredoc */ c-[si] { color: #a67f59 } /* Literal.String.Interpol */ c-[sx] { color: #a67f59 } /* Literal.String.Other */ c-[sr] { color: #a67f59 } /* Literal.String.Regex */ c-[ss] { color: #a67f59 } /* Literal.String.Symbol */ c-[vc] { color: #0077aa } /* Name.Variable.Class */ c-[vg] { color: #0077aa } /* Name.Variable.Global */ c-[vi] { color: #0077aa } /* Name.Variable.Instance */ c-[il] { color: #000000 } /* Literal.Number.Integer.Long */ @media (prefers-color-scheme: dark) { .highlight:not(.idl) { background: rgba(255, 255, 255, .05); } c-[a] { color: #d33682 } /* Keyword.Declaration */ c-[b] { color: #d33682 } /* Keyword.Type */ c-[c] { color: #2aa198 } /* Comment */ c-[d] { color: #2aa198 } /* Comment.Multiline */ c-[e] { color: #268bd2 } /* Name.Attribute */ c-[f] { color: #b58900 } /* Name.Tag */ c-[g] { color: #cb4b16 } /* Name.Variable */ c-[k] { color: #d33682 } /* Keyword */ c-[l] { color: #657b83 } /* Literal */ c-[m] { color: #657b83 } /* Literal.Number */ c-[n] { color: #268bd2 } /* Name */ c-[o] { color: #657b83 } /* Operator */ c-[p] { color: #657b83 } /* Punctuation */ c-[s] { color: #6c71c4 } /* Literal.String */ c-[t] { color: #6c71c4 } /* Literal.String.Single */ c-[u] { color: #6c71c4 } /* Literal.String.Double */ c-[ch] { color: #2aa198 } /* Comment.Hashbang */ c-[cp] { color: #2aa198 } /* Comment.Preproc */ c-[cpf] { color: #2aa198 } /* Comment.PreprocFile */ c-[c1] { color: #2aa198 } /* Comment.Single */ c-[cs] { color: #2aa198 } /* Comment.Special */ c-[kc] { color: #d33682 } /* Keyword.Constant */ c-[kn] { color: #d33682 } /* Keyword.Namespace */ c-[kp] { color: #d33682 } /* Keyword.Pseudo */ c-[kr] { color: #d33682 } /* Keyword.Reserved */ c-[ld] { color: #657b83 } /* Literal.Date */ c-[nc] { color: #268bd2 } /* Name.Class */ c-[no] { color: #268bd2 } /* Name.Constant */ c-[nd] { color: #268bd2 } /* Name.Decorator */ c-[ni] { color: #268bd2 } /* Name.Entity */ c-[ne] { color: #268bd2 } /* Name.Exception */ c-[nf] { color: #268bd2 } /* Name.Function */ c-[nl] { color: #268bd2 } /* Name.Label */ c-[nn] { color: #268bd2 } /* Name.Namespace */ c-[py] { color: #268bd2 } /* Name.Property */ c-[ow] { color: #657b83 } /* Operator.Word */ c-[mb] { color: #657b83 } /* Literal.Number.Bin */ c-[mf] { color: #657b83 } /* Literal.Number.Float */ c-[mh] { color: #657b83 } /* Literal.Number.Hex */ c-[mi] { color: #657b83 } /* Literal.Number.Integer */ c-[mo] { color: #657b83 } /* Literal.Number.Oct */ c-[sa] { color: #6c71c4 } /* Literal.String.Affix */ c-[sb] { color: #6c71c4 } /* Literal.String.Backtick */ c-[sc] { color: #6c71c4 } /* Literal.String.Char */ c-[dl] { color: #6c71c4 } /* Literal.String.Delimiter */ c-[sd] { color: #6c71c4 } /* Literal.String.Doc */ c-[se] { color: #6c71c4 } /* Literal.String.Escape */ c-[sh] { color: #6c71c4 } /* Literal.String.Heredoc */ c-[si] { color: #6c71c4 } /* Literal.String.Interpol */ c-[sx] { color: #6c71c4 } /* Literal.String.Other */ c-[sr] { color: #6c71c4 } /* Literal.String.Regex */ c-[ss] { color: #6c71c4 } /* Literal.String.Symbol */ c-[fm] { color: #268bd2 } /* Name.Function.Magic */ c-[vc] { color: #cb4b16 } /* Name.Variable.Class */ c-[vg] { color: #cb4b16 } /* Name.Variable.Global */ c-[vi] { color: #cb4b16 } /* Name.Variable.Instance */ c-[vm] { color: #cb4b16 } /* Name.Variable.Magic */ c-[il] { color: #657b83 } /* Literal.Number.Integer.Long */ } </style> <style>/* Boilerplate: style-wpt */ :root { --wpt-border: hsl(0, 0%, 60%); --wpt-bg: hsl(0, 0%, 95%); --wpt-text: var(--text); --wptheading-text: hsl(0, 0%, 30%); } @media (prefers-color-scheme: dark) { :root { --wpt-border: hsl(0, 0%, 30%); --wpt-bg: var(--borderedblock-bg); --wpt-text: var(--text); --wptheading-text: hsl(0, 0%, 60%); } } .wpt-tests-block { list-style: none; border-left: .5em solid var(--wpt-border); background: var(--wpt-bg); color: var(--wpt-text); margin: 1em auto; padding: .5em; } .wpt-tests-block summary { color: var(--wptheading-text); font-weight: normal; text-transform: uppercase; } .wpt-tests-block summary::marker{ color: var(--wpt-border); } .wpt-tests-block summary:hover::marker{ color: var(--wpt-text); } /* The only content of a wpt test block in its closed state is the <summary>, which contains the word TESTS, and that is absolutely positioned. In that closed state, wpt test blocks are styled to have a top margin whose height is exactly equal to the height of the absolutely positioned <summary>, and no other background/padding/margin/border. The wpt test block elements will therefore allow the maring of the previous/next block elements to collapse through them; if this combined margin would be larger than its own top margin, it stays as is, and therefore the pre-existing vertical rhythm of the document is undisturbed. If that combined margin would be smaller, it is grown to that size. This means that the wpt test block ensures that there's always enough vertical space to insert the summary, without adding more than is needed. */ .wpt-tests-block:not([open]){ padding: 0; border: none; background: none; font-size: 0.75em; line-height: 1; position: relative; margin: 1em 0 0; } .wpt-tests-block:not([open]) summary { position: absolute; right: 0; bottom: 0; } /* It is possible that both the last child of a block element and the block element itself would be annotated with a <wpt> block each. If the block element has a padding or a border, that's fine, but otherwise the bottom margin of the block and of its last child would collapse and both <wpt> elements would overlap, being both placed there. To avoid that, add 1px of padding to the <wpt> element annotating the last child to prevent the bottom margin of the block and of its last child from collapsing (and as much negative margin, as wel only want to prevent margin collapsing, but are not trying to actually take more space). */ .wpt-tests-block:not([open]):last-child { padding-bottom: 1px; margin-bottom: -1px; } /* Exception to the previous rule: don't do that in non-last list items, because it's not necessary, and would therefore consume more space than strictly needed. Lists must have list items as children, not <wpt> elements, so a <wpt> element cannot be a sibling of a list item, and the collision that the previous rule avoids cannot happen. */ li:not(:last-child) > .wpt-tests-block:not([open]):last-child, dd:not(:last-child) > .wpt-tests-block:not([open]):last-child { padding-bottom: 0; margin-bottom: 0; } .wpt-tests-block:not([open]):not(:hover){ opacity: 0.5; } .wpt-tests-list { list-style: none; display: grid; margin: 0; padding: 0; grid-template-columns: 1fr max-content auto auto; grid-column-gap: .5em; } .wpt-tests-block hr:last-child { display: none; } .wpt-test { display: contents; } .wpt-test > a { text-decoration: underline; border: none; } .wpt-test > .wpt-name { grid-column: 1; } .wpt-test > .wpt-results { grid-column: 2; } .wpt-test > .wpt-live { grid-column: 3; } .wpt-test > .wpt-source { grid-column: 4; } .wpt-test > .wpt-results { display: flex; gap: .1em; } .wpt-test .wpt-result { display: inline-block; height: 1em; width: 1em; border-radius: 50%; position: relative; } </style> <body class="h-entry"> <div class="head"> <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2021/logos/W3C" width="72"> </a> </p> <h1 class="p-name no-ref" id="title">CSS Generated Content Module Level 3</h1> <p id="w3c-state"><a href="https://www.w3.org/standards/types/#ED">Editor’s Draft</a>, <time class="dt-updated" datetime="2024-05-17">17 May 2024</time></p> <details open> <summary>More details about this document</summary> <div data-fill-with="spec-metadata"> <dl> <dt>This version: <dd><a class="u-url" href="https://drafts.csswg.org/css-content-3/">https://drafts.csswg.org/css-content-3/</a> <dt>Latest published version: <dd><a href="https://www.w3.org/TR/css-content-3/">https://www.w3.org/TR/css-content-3/</a> <dt>Previous Versions: <dd><a href="https://www.w3.org/TR/2016/WD-css-content-3-20160602/" rel="prev">https://www.w3.org/TR/2016/WD-css-content-3-20160602/</a> <dt>Feedback: <dd><a href="https://github.com/w3c/csswg-drafts/labels/css-content-3">CSSWG Issues Repository</a> <dd><a href="#issues-index">Inline In Spec</a> <dt class="editor">Editors: <dd class="editor p-author h-card vcard" data-editor-id="35400"><a class="p-name fn u-url url" href="http://fantasai.inkedblade.net/contact">Elika J. Etemad / fantasai</a> (<span class="p-org org">W3C Invited Expert</span>) <dd class="editor p-author h-card vcard" data-editor-id="118053"><a class="p-name fn u-email email" href="mailto:mike@bfo.com">Mike Bremford</a> (<span class="p-org org">BFO</span>) <dt class="editor">Former Editors: <dd class="editor p-author h-card vcard" data-editor-id="65283"><a class="p-name fn u-email email" href="mailto:dauwhe@gmail.com">Dave Cramer</a> (<span class="p-org org">Hachette Livre</span>) <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:howcome@opera.com">Håkon Wium Lie</a> (<span class="p-org org">Opera Software</span>) <dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:ian@hixie.ch">Ian Hickson</a> (<span class="p-org org">Google</span>) <dt>Suggest an Edit for this Spec: <dd><a href="https://github.com/w3c/csswg-drafts/blob/main/css-content-3/Overview.bs">GitHub Editor</a> </dl> </div> </details> <div data-fill-with="warning"></div> <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/policies/#copyright">Copyright</a> © 2024 <a href="https://www.w3.org/">World Wide Web Consortium</a>. <abbr title="World Wide Web Consortium">W3C</abbr><sup>®</sup> <a href="https://www.w3.org/policies/#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/policies/#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/copyright/software-license/" rel="license" title="W3C Software and Document License">permissive document license</a> rules apply. </p> <hr title="Separator for header"> </div> <div class="p-summary" data-fill-with="abstract"> <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2> <p>This CSS3 Module describes how to insert content in a document.</p> <a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, etc. <script> const githubPrefix = "https://w3c.github.io/csswg-drafts/"; if(location.href.slice(0, githubPrefix.length) == githubPrefix) { const suffix = location.href.slice(githubPrefix.length); const draftUrl = "https://drafts.csswg.org/" + suffix; window.location.replace(draftUrl); } </script> </div> <h2 class="no-num no-toc no-ref heading settled" id="sotd"><span class="content">Status of this document</span></h2> <div data-fill-with="status"> <p> This is a public copy of the editors’ draft. It is provided for discussion only and may change at any moment. Its publication here does not imply endorsement of its contents by W3C. Don’t cite this document other than as work in progress. </p> <p>Please send feedback by <a href="https://github.com/w3c/csswg-drafts/issues">filing issues in GitHub</a> (preferred), including the spec code “css-content” in the title, like this: “[css-content] <i>…summary of comment…</i>”. All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>. Alternately, feedback can be sent to the (<a href="https://lists.w3.org/Archives/Public/www-style/">archived</a>) public mailing list <a href="mailto:www-style@w3.org?Subject=%5Bcss-content%5D%20PUT%20SUBJECT%20HERE">www-style@w3.org</a>. </p> <p>This document is governed by the <a href="https://www.w3.org/policies/process/20231103/" id="w3c_process_revision">03 November 2023 W3C Process Document</a>. </p> <p></p> <p>This is a very rough draft, and is not ready for implementation.</p> </div> <div data-fill-with="at-risk"></div> <nav data-fill-with="table-of-contents" id="toc"> <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2> <ol class="toc" role="directory"> <li> <a href="#intro"><span class="secno"></span> <span class="content"> Introduction</span></a> <ol class="toc"> <li><a href="#values"><span class="secno"></span> <span class="content"> Value Definitions</span></a> </ol> <li> <a href="#content-property"><span class="secno">1</span> <span class="content"> Inserting and Replacing Content: the <span class="property">content</span> property</span></a> <ol class="toc"> <li><a href="#accessibility"><span class="secno">1.1</span> <span class="content"> Accessibility of Generated Content</span></a> <li><a href="#alt"><span class="secno">1.2</span> <span class="content"> Alternative Text for Accessibility</span></a> </ol> <li> <a href="#content-values"><span class="secno">2</span> <span class="content"> Generated Content Values: the <span class="production">&lt;content-list></span> type</span></a> <ol class="toc"> <li><a href="#strings"><span class="secno">2.1</span> <span class="content"> Basic Strings: <span class="production">&lt;string></span> and <span class="production">&lt;attr()></span> values</span></a> <li><a href="#content-uri"><span class="secno">2.2</span> <span class="content"> 2D Images: <span class="production">&lt;image></span> values</span></a> <li><a href="#element-content"><span class="secno">2.3</span> <span class="content"> Elemental Content: the <span class="css">contents</span> keyword</span></a> <li> <a href="#quotes"><span class="secno">2.4</span> <span class="content"> Quotation Marks</span></a> <ol class="toc"> <li><a href="#quotes-property"><span class="secno">2.4.1</span> <span class="content"> Quotation Mark System: the <span class="property">quotes</span> property</span></a> <li><a href="#quote-values"><span class="secno">2.4.2</span> <span class="content"> Inserting Quotation Marks: the <span class="css">*-quote</span> keywords</span></a> </ol> <li> <a href="#leaders"><span class="secno">2.5</span> <span class="content"> Leaders</span></a> <ol class="toc"> <li><a href="#leader-function"><span class="secno">2.5.1</span> <span class="content"> The <span class="css">leader()</span> function</span></a> <li><a href="#leader-rules"><span class="secno">2.5.2</span> <span class="content"> Rendering leaders</span></a> <li><a href="#leader-alignment"><span class="secno">2.5.3</span> <span class="content"> Procedure for rendering leaders</span></a> </ol> <li> <a href="#cross-references"><span class="secno">2.6</span> <span class="content"> Cross References</span></a> <ol class="toc"> <li><a href="#target-counter"><span class="secno">2.6.1</span> <span class="content"> The <span class="css">target-counter()</span> function</span></a> <li><a href="#target-counters"><span class="secno">2.6.2</span> <span class="content"> The <span class="css">target-counters()</span> function </span></a> <li><a href="#target-text"><span class="secno">2.6.3</span> <span class="content"> The <span class="css">target-text()</span> function</span></a> </ol> <li> <a href="#named-strings"><span class="secno">2.7</span> <span class="content"> Named Strings</span></a> <ol class="toc"> <li><a href="#string-set"><span class="secno">2.7.1</span> <span class="content"> Naming Strings: the <span class="property">string-set</span> property</span></a> <li><a href="#string-function"><span class="secno">2.7.2</span> <span class="content"> Inserting Named Strings: the <span class="css">string()</span> function</span></a> <li><a href="#content-function"><span class="secno">2.7.3</span> <span class="content"> The <span class="css">content()</span> function</span></a> </ol> <li><a href="#counters"><span class="secno">2.8</span> <span class="content"> Automatic Counters and Numbering</span></a> </ol> <li> <a href="#bookmark-generation"><span class="secno">3</span> <span class="content"> Bookmarks</span></a> <ol class="toc"> <li><a href="#bookmark-level"><span class="secno">3.1</span> <span class="content"> Setting a Bookmark: the <span class="property">bookmark-level</span> property </span></a> <li><a href="#bookmark-label"><span class="secno">3.2</span> <span class="content"> Labelling a Bookmark: the <span class="property">bookmark-label</span> property</span></a> <li><a href="#bookmark-state"><span class="secno">3.3</span> <span class="content"> Initial Bookmark Toggle State: the <span class="property">bookmark-state</span> property</span></a> </ol> <li><a href="#changes"><span class="secno">4</span> <span class="content">Changes</span></a> <li><a href="#acknowledgements"><span class="secno"></span> <span class="content">Acknowledgements</span></a> <li><a href="#privacy"><span class="secno"></span> <span class="content">Privacy Considerations</span></a> <li><a href="#security"><span class="secno"></span> <span class="content">Security Considerations</span></a> <li> <a href="#w3c-conformance"><span class="secno"></span> <span class="content"> Conformance</span></a> <ol class="toc"> <li><a href="#w3c-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a> <li><a href="#w3c-conformance-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a> <li> <a href="#w3c-partial"><span class="secno"></span> <span class="content"> Partial implementations</span></a> <ol class="toc"> <li><a href="#w3c-conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a> </ol> <li><a href="#w3c-testing"><span class="secno"></span> <span class="content"> Non-experimental implementations</span></a> </ol> <li> <a href="#index"><span class="secno"></span> <span class="content">Index</span></a> <ol class="toc"> <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a> <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a> </ol> <li> <a href="#references"><span class="secno"></span> <span class="content">References</span></a> <ol class="toc"> <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a> <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a> </ol> <li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a> <li><a href="#issues-index"><span class="secno"></span> <span class="content">Issues Index</span></a> </ol> </nav> <main> <h2 class="no-num heading settled" id="intro"><span class="content"> Introduction</span></h2> <p>Authors sometimes want user agents to render content that does not come from the document tree. One familiar example of this is numbered headings; the author does not want to mark the numbers up explicitly, they want the user agent to generate them automatically. Counters and markers are used to achieve these effects.</p> <div class="example" id="example-47d87e9c"> <a class="self-link" href="#example-47d87e9c"></a> <pre class="highlight"><c- k>h1</c-><c- p>:</c->:before <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- nf>counter</c-><c- p>(</c->section<c- p>)</c-> <c- s>": "</c-><c- p>;</c-> <c- p>}</c-> </pre> </div> <p>Similarly, authors may want the user agent to insert the word "Figure" before the caption of a figure, or "Chapter 7" on a line before the seventh chapter title.</p> <div class="example" id="example-5a4a3cc1"> <a class="self-link" href="#example-5a4a3cc1"></a> <pre class="highlight">chapter <c- p>{</c-> <c- k>counter-increment</c-><c- p>:</c-> chapter<c- p>;</c-> <c- p>}</c-> chapter > title::before <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- s>"Chapter "</c-> <c- nf>counter</c-><c- p>(</c->chapter<c- p>)</c-> <c- s>"\A"</c-><c- p>;</c-> <c- p>}</c-> </pre> </div> <p>Another common effect is replacing elements with images or other multimedia content. Since not all user agents support all multimedia formats, fallbacks may have to be provided.</p> <div class="example" id="example-856d72ea"> <a class="self-link" href="#example-856d72ea"></a> <pre class="highlight"><c- c>/* Replace &lt;logo> elements with the site’s logo, using a format</c-> <c- c> * supported by the UA */</c-> logo <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- nf>url</c-><c- p>(</c-><c- s>logo.mov</c-><c- p>),</c-> <c- nf>url</c-><c- p>(</c-><c- s>logo.mng</c-><c- p>),</c-> <c- nf>url</c-><c- p>(</c-><c- s>logo.png</c-><c- p>),</c-> none<c- p>;</c-> <c- p>}</c-> <c- c>/* Replace &lt;figure> elements with the referenced document, or,</c-> <c- c> * failing that, with either the contents of the alt attribute or the</c-> <c- c> * contents of the element itself if there is no alt attribute */</c-> figure<c- p>[</c->alt<c- p>]</c-> <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- nf>attr</c-><c- p>(</c->href url<c- p>),</c-> <c- nf>attr</c-><c- p>(</c->alt<c- p>);</c-> <c- p>}</c-> figure<c- nf>:not</c-><c- p>([</c->alt<c- p>])</c-> <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- nf>attr</c-><c- p>(</c->href url<c- p>),</c-> contents<c- p>;</c-> <c- p>}</c-> </pre> </div> <h3 class="heading settled" id="values"><span class="content"> Value Definitions</span></h3> <p>This specification follows the <a href="https://www.w3.org/TR/CSS2/about.html#property-defs">CSS property definition conventions</a> from <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a> using the <a href="https://www.w3.org/TR/css-values-3/#value-defs">value definition syntax</a> from <a data-link-type="biblio" href="#biblio-css-values-3" title="CSS Values and Units Module Level 3">[CSS-VALUES-3]</a>. Value types not defined in this specification are defined in CSS Values &amp; Units <span title="CSS Values and Units Module Level 3">[CSS-VALUES-3]</span>. Combination with other CSS modules may expand the definitions of these value types.</p> <p>In addition to the property-specific values listed in their definitions, all properties defined in this specification also accept the <a data-link-type="dfn" href="https://drafts.csswg.org/css-values-4/#css-wide-keywords" id="ref-for-css-wide-keywords">CSS-wide keywords</a> as their property value. For readability they have not been repeated explicitly.</p> <h2 class="heading settled" data-level="1" id="content-property"><span class="secno">1. </span><span class="content"> Inserting and Replacing Content: the <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content">content</a> property</span><a class="self-link" href="#content-property"></a></h2> <table class="def propdef" data-link-for-hint="content"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-content">content</dfn> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">Value:</a> <td class="prod">normal <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one">|</a> none <span id="ref-for-comb-one①">|</span> [ <a class="production css" data-link-type="type" href="#typedef-content-content-replacement" id="ref-for-typedef-content-content-replacement">&lt;content-replacement></a> <span id="ref-for-comb-one②">|</span> <a class="production css" data-link-type="type" href="#typedef-content-content-list" id="ref-for-typedef-content-content-list">&lt;content-list></a> ] [/ [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value">&lt;string></a> <span id="ref-for-comb-one③">|</span> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-lists-3/#typedef-counter" id="ref-for-typedef-counter">&lt;counter></a> <span id="ref-for-comb-one④">|</span> <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-values-5/#funcdef-attr" id="ref-for-funcdef-attr">&lt;attr()></a> ]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-one-plus" id="ref-for-mult-one-plus">+</a> ]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt">?</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a> <td>normal <tr> <th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a> <td>all elements, tree-abiding pseudo-elements, and page margin boxes <tr> <th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://www.w3.org/TR/css-values/#percentages">Percentages:</a> <td>n/a <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>See prose below <tr> <th><a href="https://www.w3.org/TR/cssom/#serializing-css-values">Canonical order:</a> <td>per grammar <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>discrete </table> <p class="all-media">User agents are expected to support this property on all media, including non-visual ones.</p> <p>The <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content①">content</a> property dictates what is rendered inside an element or pseudo-element.</p> <p>For elements, it has only one purpose: specifying that the element renders as normal, or replacing the element with an image (and possibly some associated "alt text").</p> <p>For pseudo-elements and margin boxes, it is more powerful. It controls whether the element renders at all, can replace the element with an image, or replace it with arbitrary inline content (text and images).</p> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="content" data-dfn-type="value" data-export id="valdef-content-normal">normal</dfn> <dd> For an element or page margin box, this computes to <a class="css" data-link-type="maybe" href="#valdef-content-contents" id="ref-for-valdef-content-contents">contents</a>. <p>For <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-before" id="ref-for-selectordef-before">::before</a> and <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-after" id="ref-for-selectordef-after">::after</a>, this computes to <a class="css" data-link-type="maybe" href="#valdef-content-none" id="ref-for-valdef-content-none">none</a>.</p> <p>For <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-marker" id="ref-for-selectordef-marker">::marker</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-placeholder" id="ref-for-selectordef-placeholder">::placeholder</a>, and <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-file-selector-button" id="ref-for-selectordef-file-selector-button">::file-selector-button</a>, this computes to itself (<a class="css" data-link-type="maybe" href="#valdef-content-normal" id="ref-for-valdef-content-normal">normal</a>).</p> <dt><dfn class="dfn-paneled css" data-dfn-for="content" data-dfn-type="value" data-export id="valdef-content-none">none</dfn> <dd> On elements, this behaves as <a class="css" data-link-type="maybe" href="#valdef-content-normal" id="ref-for-valdef-content-normal①">normal</a>. <p>On <a data-link-type="dfn" href="https://www.w3.org/TR/CSS21/selector.html#x22" id="ref-for-x22">pseudo-elements</a> it inhibits the creation of the pseudo-element as if it had <a class="css" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-4/#propdef-display" id="ref-for-propdef-display">display: none</a>.</p> <p>In neither case does it prevent any pseudo-elements which have this element or pseudo-element as an <a data-link-type="dfn" href="https://drafts.csswg.org/selectors-4/#originating-element" id="ref-for-originating-element">originating element</a> from being generated.</p> <dt><dfn class="dfn-paneled css" data-dfn-for="content" data-dfn-type="type" data-export id="typedef-content-content-replacement"><a class="production css" data-link-type="type" href="#typedef-content-content-replacement" id="ref-for-typedef-content-content-replacement①">&lt;content-replacement></a></dfn> <dd id="replaced"> Equal to: <pre class="prod highlight"><a class="production" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image">&lt;image></a></pre> <p>Makes the element or pseudo-element a <a href="https://www.w3.org/TR/CSS2/conform.html#replaced-element">replaced element</a>, filled with the specified <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image①">&lt;image></a>. Its normal contents are suppressed and do not generate boxes, as if they were <a class="css" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-4/#propdef-display" id="ref-for-propdef-display①">display: none</a>.</p> <p>If the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image②">&lt;image></a> represents an <a data-link-type="dfn" href="https://drafts.csswg.org/css-images-4/#invalid-image" id="ref-for-invalid-image">invalid image</a>, then it must be treated as instead representing an image with zero <a data-link-type="dfn" href="https://drafts.csswg.org/css-images-3/#natural-dimensions" id="ref-for-natural-dimensions">natural</a> width and height, filled with transparent black.</p> <p class="issue" id="issue-b8fd18a9"><a class="self-link" href="#issue-b8fd18a9"></a> The above <a data-link-type="dfn" href="https://drafts.csswg.org/css-images-4/#invalid-image" id="ref-for-invalid-image①">invalid image</a> behavior appears to be what Chrome is doing. Is this okay? Is there a better behavior we can/should use?</p> <p class="note" role="note"><span class="marker">Note:</span> Replaced elements use different layout rules than normal elements. (In effect, it becomes equivalent to an HTML <code class="highlight"><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element" id="ref-for-the-img-element">img</a></code> element.)</p> <p class="note" role="note"><span class="marker">Note:</span> Replaced elements do not have <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-before" id="ref-for-selectordef-before①">::before</a> or <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-after" id="ref-for-selectordef-after①">::after</a> pseudo-elements; the <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content②">content</a> property replaces their entire contents.</p> <p class="issue" id="issue-7afc79f1"><a class="self-link" href="#issue-7afc79f1"></a> This value has historically been treated as <a class="production css" data-link-type="type" href="#typedef-content-content-list" id="ref-for-typedef-content-content-list①">&lt;content-list></a> on <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-before" id="ref-for-selectordef-before②">::before</a> and <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-after" id="ref-for-selectordef-after②">::after</a>. Presumably there’s a Web-compat requirement on this, so these pseudo-elements might need an exception. <a href="https://github.com/w3c/csswg-drafts/issues/2889">[Issue #2889]</a></p> <dt><dfn class="dfn-paneled css" data-dfn-for="content" data-dfn-type="type" data-export id="typedef-content-content-list"><a class="production css" data-link-type="type" href="#typedef-content-content-list" id="ref-for-typedef-content-content-list②">&lt;content-list></a></dfn> <dd> Replaces the element’s contents with one or more anonymous inline boxes corresponding to the specified values, in the order specified. Its normal contents are suppressed and do not generate boxes, as if they were <a class="css" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-4/#propdef-display" id="ref-for-propdef-display②">display: none</a>. <p>Each value contributes an inline box to the element’s contents. For <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image③">&lt;image></a>, this is an inline anonymous replaced element; for the others, it’s an anonymous inline run of text.</p> <p>If an <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image④">&lt;image></a> represents an <a data-link-type="dfn" href="https://drafts.csswg.org/css-images-4/#invalid-image" id="ref-for-invalid-image②">invalid image</a>, the user agent must do one of the following:</p> <ul> <li data-md> <p>"Skip" the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image⑤">&lt;image></a>, generating nothing for it.</p> <li data-md> <p>Display some indication that the image can’t be displayed in place of the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image⑥">&lt;image></a>, such as a "broken image" icon.</p> </ul> <p>This specification intentionally does not define which behavior a user agent must use, but it must use one or the other consistently.</p> <p class="note" role="note"><span class="marker">Note:</span> If the value of <a class="production css" data-link-type="type" href="#typedef-content-content-list" id="ref-for-typedef-content-content-list③">&lt;content-list></a> is a single <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image⑦">&lt;image></a>, it must instead be interpreted as a <a class="production css" data-link-type="type" href="#typedef-content-content-replacement" id="ref-for-typedef-content-content-replacement②">&lt;content-replacement></a>.</p> <dt><dfn class="dfn-paneled css" data-dfn-for="content" data-dfn-type="value" data-export id="valdef-content---string--counter--attr">/ [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value①">&lt;string></a> | <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-lists-3/#typedef-counter" id="ref-for-typedef-counter①">&lt;counter></a> | <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-values-5/#funcdef-attr" id="ref-for-funcdef-attr①">&lt;attr()></a> ]+</dfn> <dd> Specifies the "alt text" for the element. See <a href="#alt">§ 1.2 Alternative Text for Accessibility</a> for details. If omitted, the element has no "alt text". </dl> <p class="issue" id="issue-a8fbc981"><a class="self-link" href="#issue-a8fbc981"></a> Should the contents keyword be replaced with <a class="css" data-link-type="maybe" href="#funcdef-content" id="ref-for-funcdef-content">content()</a>?</p> <h3 class="heading settled" data-level="1.1" id="accessibility"><span class="secno">1.1. </span><span class="content"> Accessibility of Generated Content</span><a class="self-link" href="#accessibility"></a></h3> <p>Generated content should be searchable, selectable, and available to assistive technologies. The <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content③">content</a> property applies to speech and generated content must be rendered for speech output. <a data-link-type="biblio" href="#biblio-css3-speech" title="CSS Speech Module Level 1">[CSS3-SPEECH]</a></p> <p class="issue" id="issue-9c60e2c1"><a class="self-link" href="#issue-9c60e2c1"></a> Start work on an AAM for CSS.</p> <h3 class="heading settled" data-level="1.2" id="alt"><span class="secno">1.2. </span><span class="content"> Alternative Text for Accessibility</span><a class="self-link" href="#alt"></a></h3> <p>Content intended for visual media sometimes needs alternative text for speech output or other non-visual mediums. The <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content④">content</a> property thus accepts alternative text to be specified after a slash (<span class="css">/</span>) after the last <a class="production css" data-link-type="type" href="#typedef-content-content-list" id="ref-for-typedef-content-content-list④">&lt;content-list></a>. If such alternative text is provided, it must be used for speech output instead.</p> <p>This allows, for example, purely decorative text to be elided in speech output (by providing the empty string as alternative text), and allows authors to provide more readable alternatives to images, icons, or text-encoded symbols.</p> <div class="example" id="example-ff5073a7"> <a class="self-link" href="#example-ff5073a7"></a> Here the content property is an image, so the alt value is required to provide alternative text. <pre class="highlight">.new::before <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- nf>url</c-><c- p>(</c-><c- s>./img/star.png</c-><c- p>)</c-> / <c- s>"New!"</c-><c- p>;</c-> <c- c>/* or a localized attribute from the DOM: attr("data-alt") */</c-> <c- p>}</c-> </pre> </div> <div class="example" id="example-954890b1"> <a class="self-link" href="#example-954890b1"></a> If the pseudo-element is purely decorative and its function is covered elsewhere, setting alt to the empty string can avoid reading out the decorative element. Here the ARIA attribute will be spoken as "collapsed". Without the empty string alt value, the content would also be spoken as "Black right-pointing pointer". <pre class="highlight">.expandable::before <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- s>"\25BA"</c-> / <c- s>""</c-><c- p>;</c-> <c- c>/* a.k.a. ► */</c-> <c- c>/* aria-expanded="false" already in DOM,</c-> <c- c> so this pseudo-element is decorative */</c-> <c- p>}</c-> </pre> </div> <h2 class="heading settled" data-level="2" id="content-values"><span class="secno">2. </span><span class="content"> Generated Content Values: the <a class="production css" data-link-type="type" href="#typedef-content-content-list" id="ref-for-typedef-content-content-list⑤">&lt;content-list></a> type</span><a class="self-link" href="#content-values"></a></h2> <p>The <a class="production css" data-link-type="type" href="#typedef-content-content-list" id="ref-for-typedef-content-content-list⑥">&lt;content-list></a> value is used in <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content⑤">content</a> to fill an element with one or more anonymous inline boxes, including images, strings, the values of counters, and the text value of elements. In this section we enumerate the possibilities.</p> <p>The syntax of <a class="production css" data-link-type="type" href="#typedef-content-content-list" id="ref-for-typedef-content-content-list⑦">&lt;content-list></a> is defined as:</p> <pre class="prod highlight"><a class="production" data-link-type="type" href="#typedef-content-content-list" id="ref-for-typedef-content-content-list⑧">&lt;content-list></a> = <c- p>[</c-> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value②">&lt;string></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑤">|</a> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image⑧">&lt;image></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑥">|</a> <a class="production" data-link-type="function" href="https://drafts.csswg.org/css-values-5/#funcdef-attr" id="ref-for-funcdef-attr②">&lt;<c- nf>attr</c-><c- p>()</c->></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑦">|</a> contents <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑧">|</a> <a class="production" data-link-type="type" href="#typedef-quote" id="ref-for-typedef-quote">&lt;quote></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one⑨">|</a> <a class="production" data-link-type="function" href="#funcdef-content-leader" id="ref-for-funcdef-content-leader">&lt;<c- nf>leader</c-><c- p>()</c->></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⓪">|</a> <a class="production" data-link-type="type" href="#typedef-target" id="ref-for-typedef-target">&lt;target></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①①">|</a> <a class="production" data-link-type="function" href="#funcdef-string" id="ref-for-funcdef-string">&lt;<c- nf>string</c-><c- p>()</c->></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①②">|</a> <a class="production" data-link-type="function" href="#funcdef-content" id="ref-for-funcdef-content①">&lt;<c- nf>content</c-><c- p>()</c->></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①③">|</a> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-lists-3/#typedef-counter" id="ref-for-typedef-counter②">&lt;counter></a> <c- p>]</c-><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-one-plus" id="ref-for-mult-one-plus①">+</a> </pre> <h3 class="heading settled" data-level="2.1" id="strings"><span class="secno">2.1. </span><span class="content"> Basic Strings: <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value③">&lt;string></a> and <a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-values-5/#funcdef-attr" id="ref-for-funcdef-attr③">&lt;attr()></a> values</span><a class="self-link" href="#strings"></a></h3> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="content, <content-list>" data-dfn-type="value" data-export id="valdef-content-string"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value④">&lt;string></a></dfn> <dd> Represents an anonymous inline box filled with the specified text. <p class="note" role="note"><span class="marker">Note:</span> <a data-link-type="dfn" href="https://drafts.csswg.org/css-text-4/#white-space" id="ref-for-white-space">White space</a> in the string is handled the same as in literal text, and controlled by the properties in <a data-link-type="biblio" href="#biblio-css-text-3" title="CSS Text Module Level 3">[CSS-TEXT-3]</a> and elsewhere. In particular, <span id="ref-for-white-space①">white space</span> character can collapse, even across multiple strings, such as in <a class="css" data-link-type="propdesc" href="#propdef-content" id="ref-for-propdef-content⑥">content: "First " " Second";</a>, which by default will render similar to <code class="highlight"><c- s>"First Second"</c-></code> (with a single visible space between the two words).</p> <dt><a class="production css" data-link-type="function" href="https://drafts.csswg.org/css-values-5/#funcdef-attr" id="ref-for-funcdef-attr④">&lt;attr()></a> <dd> The <dfn class="dfn-paneled css" data-dfn-for="content, <content-list>" data-dfn-type="value" data-noexport id="valdef-content-attr">attr()</dfn> functional notation represents the string stored as the specified attribute’s value. Its argument is a <a data-link-type="dfn" href="https://drafts.csswg.org/css-namespaces-3/#css-qualified-name" id="ref-for-css-qualified-name">CSS qualified name</a> (<code class="highlight">qname</code>) representing the attribute name and namespace, if any. See <a data-link-type="biblio" href="#biblio-css3-namespace" title="CSS Namespaces Module Level 3">[CSS3-NAMESPACE]</a>. <p class="note" role="note"><span class="marker">Note:</span> As in <a href="https://drafts.csswg.org/selectors-4/#attrnmsp">attribute selectors</a>, attribute names without an explicit namespace do not associate with any default namespace.</p> </dl> <h3 class="heading settled" data-level="2.2" id="content-uri"><span class="secno">2.2. </span><span class="content"> 2D Images: <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image⑨">&lt;image></a> values</span><a class="self-link" href="#content-uri"></a></h3> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="<content-list>" data-dfn-type="value" data-export id="valdef-content-list-image"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image①⓪">&lt;image></a></dfn> <dd> Represents an anonymous inline replaced element filled with the specified <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image①①">&lt;image></a>. <p>If the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-images-3/#typedef-image" id="ref-for-typedef-image①②">&lt;image></a> represents an <a data-link-type="dfn" href="https://drafts.csswg.org/css-images-4/#invalid-image" id="ref-for-invalid-image③">invalid image</a>, this value instead represents nothing. (No inline content is added to the element, as if this value were "skipped".)</p> </dl> <p class="issue" id="issue-3ef3081c"><a class="self-link" href="#issue-3ef3081c"></a> CSS2.1 explicitly allowed the UA to substitute a broken image icon if the image was invalid. However, no browser appears to do this. Is this removal okay?</p> <h3 class="heading settled" data-level="2.3" id="element-content"><span class="secno">2.3. </span><span class="content"> Elemental Content: the <a class="css" data-link-type="maybe" href="#valdef-content-contents" id="ref-for-valdef-content-contents①">contents</a> keyword</span><a class="self-link" href="#element-content"></a></h3> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="content, <content-list>" data-dfn-type="value" data-export id="valdef-content-contents">contents</dfn> <dd> The element’s descendants. Since this can only be used once per element (you can’t duplicate the children if, e.g., one is a plugin or form control), it is handled as follows: <dl> <dt data-md>If set on the element: <dd data-md> <p>Always honoured. Note that this is the default, since the initial value of <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content⑦">content</a> is <a class="css" data-link-type="maybe" href="#valdef-content-normal" id="ref-for-valdef-content-normal②">normal</a> and <span class="css" id="ref-for-valdef-content-normal③">normal</span> computes to <a class="css" data-link-type="maybe" href="#valdef-content-contents" id="ref-for-valdef-content-contents②">contents</a> on an element.</p> <dt data-md>If set on one of the element’s other pseudo-elements: <dd data-md> <p>Check to see that it is not set on a "previous" pseudo-element, in the following order, depth first:</p> <ol> <li data-md> <p>the element itself</p> <li data-md> <p>::before</p> <li data-md> <p>::after</p> </ol> <p class="issue" id="issue-bf2f178e"><a class="self-link" href="#issue-bf2f178e"></a> Should this behave as an empty string on pseudo-elements?</p> <p>If it is already used, then it evaluates to nothing (like <a class="css" data-link-type="maybe" href="#valdef-content-none" id="ref-for-valdef-content-none①">none</a>). Only pseudo-elements that are actually generated are checked.</p> </dl> </dl> <div class="example" id="example-765061ba"> <a class="self-link" href="#example-765061ba"></a> In the following case: <pre class="highlight">foo <c- p>{</c-> <c- k>content</c-><c- p>:</c-> normal<c- p>;</c-> <c- p>}</c-> <c- c>/* this is the initial value */</c-> foo::after <c- p>{</c-> <c- k>content</c-><c- p>:</c-> contents<c- p>;</c-> <c- p>}</c-> </pre> <p>...the element’s <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content⑧">content</a> property would compute to <a class="css" data-link-type="maybe" href="#valdef-content-contents" id="ref-for-valdef-content-contents③">contents</a> and the after pseudo element would have no contents (equivalent to <a class="css" data-link-type="maybe" href="#valdef-content-none" id="ref-for-valdef-content-none②">none</a>) and thus would not appear.</p> <pre class="highlight">foo <c- p>{</c-> <c- k>content</c-><c- p>:</c-> none<c- p>;</c-> <c- p>}</c-> foo::after <c- p>{</c-> <c- k>content</c-><c- p>:</c-> contents<c- p>;</c-> <c- p>}</c-> </pre> <p>But in this example, the ::after pseudo-element will contain the contents of the foo element.</p> </div> <p class="issue" id="issue-bfc60bbc"><a class="self-link" href="#issue-bfc60bbc"></a> Use cases for suppressing the content on the element and using it in a pseudo-element would be welcome.</p> <p class="note" role="note"><span class="marker">Note:</span> While it is useless to include <a class="css" data-link-type="maybe" href="#valdef-content-contents" id="ref-for-valdef-content-contents④">contents</a> twice in a single <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content⑨">content</a> property, that is not a parse error. The second occurrence simply has no effect, as it has already been used. It is also not a parse error to use it on a <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-marker" id="ref-for-selectordef-marker①">::marker</a> pseudo-element, it is only during the rendering stage that it gets treated like <a class="css" data-link-type="maybe" href="#valdef-content-none" id="ref-for-valdef-content-none③">none</a>.</p> <p class="issue" id="issue-9fa9cc25"><a class="self-link" href="#issue-9fa9cc25"></a> Do we need the statement about marker pseudo-elements here? Or is this legacy from the old version of the spec?</p> <h3 class="heading settled" data-level="2.4" id="quotes"><span class="secno">2.4. </span><span class="content"> Quotation Marks</span><a class="self-link" href="#quotes"></a></h3> <p>The <span class="css">quotes</span> property, which defines the <a data-link-type="dfn" href="#quotation-mark-system" id="ref-for-quotation-mark-system">quotation mark system</a> of an element, in conjunction with the various <span class="css">*-quote</span> values of the <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content①⓪">content</a> property, which insert corresponding quotation marks as generated content, can be used to automatically insert opening and closing quotation marks, such as for the HTML <code class="highlight"><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-q-element" id="ref-for-the-q-element">q</a></code> element.</p> <h4 class="heading settled" data-level="2.4.1" id="quotes-property"><span class="secno">2.4.1. </span><span class="content"> Quotation Mark System: the <a class="property css" data-link-type="property" href="#propdef-quotes" id="ref-for-propdef-quotes">quotes</a> property</span><a class="self-link" href="#quotes-property"></a></h4> <table class="def propdef" data-link-for-hint="quotes"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-quotes">quotes</dfn> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">Value:</a> <td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①④">|</a> none <span id="ref-for-comb-one①⑤">|</span> match-parent <span id="ref-for-comb-one①⑥">|</span> [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value⑤">&lt;string></a> <span class="production" id="ref-for-string-value⑥">&lt;string></span> ]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-one-plus" id="ref-for-mult-one-plus②">+</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a> <td>auto <tr> <th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a> <td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a> <td>yes <tr> <th><a href="https://www.w3.org/TR/css-values/#percentages">Percentages:</a> <td>n/a <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>the keyword <a class="css" data-link-type="maybe" href="#valdef-quotes-none" id="ref-for-valdef-quotes-none">none</a>, the keyword <a class="css" data-link-type="maybe" href="#valdef-quotes-auto" id="ref-for-valdef-quotes-auto">auto</a> or <a class="css" data-link-type="maybe" href="#valdef-quotes-match-parent" id="ref-for-valdef-quotes-match-parent">match-parent</a>, or a list, each item a pair of string values <tr> <th><a href="https://www.w3.org/TR/cssom/#serializing-css-values">Canonical order:</a> <td>per grammar <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>discrete </table> <p class="all-media">User agents are expected to support this property on all media, including non-visual ones.</p> <p>This property specifies the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="quotation-mark-system">quotation mark system</dfn> for the element, defining how the <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content①①">content</a> property’s <a class="css" data-link-type="maybe" href="#valdef-content-open-quote" id="ref-for-valdef-content-open-quote">open-quote</a> and <a class="css" data-link-type="maybe" href="#valdef-content-close-quote" id="ref-for-valdef-content-close-quote">close-quote</a> values behave. See <a href="#quote-values">§ 2.4.2 Inserting Quotation Marks: the *-quote keywords</a>. Values have the following meanings:</p> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="quotes" data-dfn-type="value" data-export id="valdef-quotes-none">none</dfn> <dd> The <span class="css">open-quote</span> and <span class="css">close-quote</span> values of the <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content①②">content</a> property produce no quotations marks, as if they were <span class="css">no-open-quote</span> and <span class="css">no-close-quote</span> respectively. <dt><dfn class="dfn-paneled css" data-dfn-for="quotes" data-dfn-type="value" data-export id="valdef-quotes-auto">auto</dfn> <dd> A typographically appropriate <a data-link-type="dfn" href="#quotation-mark-system" id="ref-for-quotation-mark-system①">quotation mark system</a> is automatically chosen by the UA based on the <a data-link-type="dfn" href="https://drafts.csswg.org/css-text-4/#content-language" id="ref-for-content-language">content language</a> of the parent (or, if there is no parent, of the element itself). <p class="note" role="note"><span class="marker">Note:</span> The Unicode Common Locale Data Repository <a data-link-type="biblio" href="#biblio-cldr" title="Unicode Common Locale Data Repository">[CLDR]</a> maintains information on typographically appropriate quotation marks. UAs can use other sources of information as well, particularly as typographic preferences can vary; however it is encouraged to submit any improvements to Unicode so that the entire software ecosystem can benefit.</p> <dt><dfn class="dfn-paneled css" data-dfn-for="quotes" data-dfn-type="value" data-export id="valdef-quotes-match-parent">match-parent</dfn> <dd> Specifies the same <a data-link-type="dfn" href="#quotation-mark-system" id="ref-for-quotation-mark-system②">quotation mark system</a> as the parent. In general this is equivalent to inheriting the parent’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#computed-value" id="ref-for-computed-value">computed value</a>, except that <a class="css" data-link-type="maybe" href="#valdef-quotes-auto" id="ref-for-valdef-quotes-auto①">auto</a> it resolves using the same <a data-link-type="dfn" href="https://drafts.csswg.org/css-text-4/#content-language" id="ref-for-content-language①">content language</a> that the parent used. <p class="issue" id="issue-962b52bc"><a class="self-link" href="#issue-962b52bc"></a> Two possible approaches here, currently speccing the latter: a) this computes to the relevant string values, and inherits as such. b) this value effectively inherits as a keyword + a language code, meaning <a class="css" data-link-type="maybe" href="#valdef-quotes-auto" id="ref-for-valdef-quotes-auto②">auto</a>, but with this language.</p> <dt>[ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value⑦">&lt;string></a> <span class="production" id="ref-for-string-value⑧">&lt;string></span> ]+ <dd> The <a data-link-type="dfn" href="#quotation-mark-system" id="ref-for-quotation-mark-system③">quotation mark system</a> is defined as the specified list of pairs of quotation marks (opening and closing). The first pair represents the outermost level of quotation, the second pair the next level of embedding, etc. Within a pair, the <span class="css">open-quote</span> value refers to the first <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value⑨">&lt;string></a>, <span class="css">close-quote</span> refers to the second. </dl> <h4 class="heading settled" data-level="2.4.2" id="quote-values"><span class="secno">2.4.2. </span><span class="content"> Inserting Quotation Marks: the <span class="css">*-quote</span> keywords</span><a class="self-link" href="#quote-values"></a></h4> <pre class="prod highlight"><dfn class="dfn-paneled" data-dfn-type="type" data-export id="typedef-quote"><a class="production" data-link-type="type" href="#typedef-quote" id="ref-for-typedef-quote①">&lt;quote></a></dfn> = open-quote <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⑦">|</a> close-quote <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⑧">|</a> no-open-quote <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one①⑨">|</a> no-close-quote </pre> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="content, <content-list>, <quote>" data-dfn-type="value" data-export id="valdef-content-open-quote">open-quote</dfn> <dt><dfn class="dfn-paneled css" data-dfn-for="content, <content-list>, <quote>" data-dfn-type="value" data-export id="valdef-content-close-quote">close-quote</dfn> <dd> These values are replaced by the appropriate string as defined by the <a class="property css" data-link-type="property" href="#propdef-quotes" id="ref-for-propdef-quotes①">quotes</a> property, and increments (for <span class="css">no-open-quote</span>) or decrements (for <span class="css">no-close-quote</span>) the level of nesting for quotes. <dt><dfn class="dfn-paneled css" data-dfn-for="content, <content-list>, <quote>" data-dfn-type="value" data-export id="valdef-content-no-open-quote">no-open-quote</dfn> <dt><dfn class="dfn-paneled css" data-dfn-for="content, <content-list>, <quote>" data-dfn-type="value" data-export id="valdef-content-no-close-quote">no-close-quote</dfn> <dd> Inserts nothing (as in <a class="css" data-link-type="maybe" href="#valdef-content-none" id="ref-for-valdef-content-none④">none</a>), but increments (for <span class="css">no-open-quote</span>) or decrements (for <span class="css">no-close-quote</span>) the level of nesting for quotes. </dl> <p>Quotation marks can be inserted in appropriate places in a document with the <span class="css">open-quote</span> and <span class="css">close-quote</span> values of the <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content①③">content</a> property. Each occurrence of <span class="css">open-quote</span> or <span class="css">close-quote</span> is replaced by a quotation mark string as defined by the <a data-link-type="dfn" href="#quotation-mark-system" id="ref-for-quotation-mark-system④">quotation mark system</a> specified by the <a class="property css" data-link-type="property" href="#propdef-quotes" id="ref-for-propdef-quotes②">quotes</a> property, based on the <a data-link-type="dfn" href="#quote-depth" id="ref-for-quote-depth">depth of nesting</a>.</p> <p>Which pair of quotes is used depends on the nesting level of quotes (the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="quote-depth">quote depth</dfn>): the number of occurrences of <span class="css">open-quote</span> in all generated text before the current occurrence, minus the number of occurrences of <span class="css">close-quote</span> in all generated text before and including the current occurence. If the depth is 0, the first pair is used, if the depth is 1, the second pair is used, etc. If the depth is greater than the number of pairs, the last pair is repeated.</p> <p class="note" role="note"><span class="marker">Note:</span> <a data-link-type="dfn" href="#quote-depth" id="ref-for-quote-depth①">Quote depth</a> is independent of the nesting of the source document or the formatting structure. Also, like <a href="https://drafts.csswg.org/css-lists-3/#inheriting-counters">counter inheritance</a>, it operates on the “flattened element tree” in the context of the <a data-link-type="biblio" href="#biblio-dom" title="DOM Standard">[DOM]</a>.</p> <p>A <span class="css">close-quote</span> or <span class="css">no-close-quote</span> that would make the <a data-link-type="dfn" href="#quote-depth" id="ref-for-quote-depth②">quote depth</a> negative is in error and is ignored (at rendering time): the depth stays at 0 and no quote mark is inserted (although the rest of the <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content①④">content</a> property’s value is still inserted).</p> <div class="example" id="example-4eb411f3"> <a class="self-link" href="#example-4eb411f3"></a> Some typographic styles require open quotation marks to be repeated before every paragraph of a quote spanning several paragraphs, but only the last paragraph ends with a closing quotation mark. In CSS, this can be achieved by inserting "phantom" closing quotes. The keyword <span class="css">no-close-quote</span> decrements the quoting level, but does not insert a quotation mark. <p>The following style sheet puts opening quotation marks on every paragraph in a <code class="highlight">blockquote</code>, and inserts a single closing quote at the end:</p> <pre class="highlight">blockquote p::before <c- p>{</c-> <c- k>content</c-><c- p>:</c-> open-quote <c- p>}</c-> blockquote p::after <c- p>{</c-> <c- k>content</c-><c- p>:</c-> no-close-quote <c- p>}</c-> blockquote p:last-child::after <c- p>{</c-> <c- k>content</c-><c- p>:</c-> close-quote <c- p>}</c-> </pre> <p>For symmetry, there is also a <span class="css">no-open-quote</span> keyword, which inserts nothing, but increments the quotation depth by one.</p> </div> <p class="note" role="note"><span class="marker">Note:</span> If a quotation is in a different language than the surrounding text, it is customary to quote the text with the quote marks of the language of the surrounding text, not the language of the quotation itself.</p> <div class="example" id="example-8b390663"> <a class="self-link" href="#example-8b390663"></a> For example, French inside English: <blockquote> The device of the order of the garter is “Honi soit qui mal y pense.” </blockquote> <p>English inside French:</p> <blockquote> Il disait: « Il faut mettre l’action en ‹ fast forward ›. » </blockquote> <p>A style sheet like the following will set the <a class="property css" data-link-type="property" href="#propdef-quotes" id="ref-for-propdef-quotes③">quotes</a> property so that <span class="css">open-quote</span> and <span class="css">close-quote</span> will work correctly on all elements. These rules are for documents that contain only English, French, or both. One rule is needed for every additional language. Note the use of the child combinator (">") to set quotes on elements based on the language of the surrounding text:</p> <pre class="highlight"><c- nf>:lang</c-><c- p>(</c->fr<c- p>)</c-> > * <c- p>{</c-> <c- k>quotes</c-><c- p>:</c-> <c- s>"\00AB\2005"</c-> <c- s>"\2005\00BB"</c-> <c- s>"\2039\2005"</c-> <c- s>"\2005\203A"</c-> <c- p>}</c-> <c- nf>:lang</c-><c- p>(</c->en<c- p>)</c-> > * <c- p>{</c-> <c- k>quotes</c-><c- p>:</c-> <c- s>"\201C"</c-> <c- s>"\201D"</c-> <c- s>"\2018"</c-> <c- s>"\2019"</c-> <c- p>}</c-> </pre> <p>The quotation marks are shown here in a form that most people will be able to type. If you can type them directly, they will look like this:</p> <pre class="highlight"><c- nf>:lang</c-><c- p>(</c->fr<c- p>)</c-> > * <c- p>{</c-> <c- k>quotes</c-><c- p>:</c-> <c- s>"« "</c-> <c- s>" »"</c-> <c- s>"‹ "</c-> <c- s>" ›"</c-> <c- p>}</c-> <c- nf>:lang</c-><c- p>(</c->en<c- p>)</c-> > * <c- p>{</c-> <c- k>quotes</c-><c- p>:</c-> <c- s>"“"</c-> <c- s>"”"</c-> <c- s>"‘"</c-> <c- s>"’"</c-> <c- p>}</c-> </pre> </div> <div class="example" id="example-eb11c28e"> <a class="self-link" href="#example-eb11c28e"></a> For example, applying the following style sheet: <pre class="highlight"><c- c>/* Specify pairs of quotes for two levels in two languages */</c-> <c- nf>:lang</c-><c- p>(</c->en<c- p>)</c-> > q <c- p>{</c-> <c- k>quotes</c-><c- p>:</c-> <c- s>'"'</c-> <c- s>'"'</c-> <c- s>"'"</c-> <c- s>"'"</c-> <c- p>}</c-> <c- nf>:lang</c-><c- p>(</c->no<c- p>)</c-> > q <c- p>{</c-> <c- k>quotes</c-><c- p>:</c-> <c- s>"«"</c-> <c- s>"»"</c-> <c- s>"’"</c-> <c- s>"’"</c-> <c- p>}</c-> <c- c>/* Insert quotes before and after Q element content */</c-> q::before <c- p>{</c-> <c- k>content</c-><c- p>:</c-> open-quote <c- p>}</c-> q::after <c- p>{</c-> <c- k>content</c-><c- p>:</c-> close-quote <c- p>}</c-> </pre> <p>to the following HTML fragment:</p> <pre class="html-example highlight">&lt;html lang=<c- s>"en"</c->> &lt;head> &lt;title>Quotes&lt;/title> &lt;/head> &lt;body> &lt;p>&lt;q>Quote me!&lt;/q>&lt;/p> &lt;/body> &lt;/html> </pre> <p>would allow a user agent to produce:</p> <pre class="highlight"><c- s>"Quote me!"</c-> </pre> <p>while this HTML fragment:</p> <pre class="html-example highlight">&lt;html lang=<c- s>"no"</c->> &lt;head> &lt;title>Quotes&lt;/title> &lt;/head> &lt;body> &lt;p>&lt;q>Trøndere gråter når &lt;q>Vinsjan på kaia&lt;/q> blir deklamert.&lt;/q>&lt;/p> &lt;/body> &lt;/html> </pre> <p>would produce:</p> <pre class="highlight">«Trøndere gråter når ’Vinsjan på kaia’ blir deklamert.» </pre> </div> <h3 class="heading settled" data-level="2.5" id="leaders"><span class="secno">2.5. </span><span class="content"> Leaders</span><a class="self-link" href="#leaders"></a></h3> <p>A leader, sometimes known as a tab leader or a dot leader, is a repeating pattern used to visually connect content across horizontal spaces. They are most commonly used in tables of contents, between titles and page numbers. The <a class="css" data-link-type="maybe" href="#funcdef-content-leader" id="ref-for-funcdef-content-leader①">leader()</a> function, as a value for the content property, is used to create leaders in CSS. This function takes a string (the leader string), which describes the repeating pattern for the leader.</p> <h4 class="heading settled" data-level="2.5.1" id="leader-function"><span class="secno">2.5.1. </span><span class="content"> The <a class="css" data-link-type="maybe" href="#funcdef-content-leader" id="ref-for-funcdef-content-leader②">leader()</a> function</span><a class="self-link" href="#leader-function"></a></h4> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="content, <content-list>" data-dfn-type="function" data-export data-lt="leader()" id="funcdef-content-leader">leader( <a class="production css" data-link-type="type" href="#typedef-leader-type" id="ref-for-typedef-leader-type">&lt;leader-type></a> )</dfn> <dd> Inserts a leader. See the section on <a href="#leaders">leaders</a> for more information. </dl> <pre class="prod highlight"><dfn class="dfn-paneled" data-dfn-type="function" data-export id="funcdef-leader"><c- nf>leader</c-><c- p>()</c-></dfn> = <c- nf>leader</c-><c- p>(</c-> <a class="production" data-link-type="type" href="#typedef-leader-type" id="ref-for-typedef-leader-type①">&lt;leader-type></a> <c- p>)</c-> <dfn class="dfn-paneled" data-dfn-type="type" data-export id="typedef-leader-type"><a class="production" data-link-type="type" href="#typedef-leader-type" id="ref-for-typedef-leader-type②">&lt;leader-type></a></dfn> = dotted <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②⓪">|</a> solid <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②①">|</a> space <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②②">|</a> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value①⓪">&lt;string></a> </pre> <p>Three keywords are shorthand values for common strings:</p> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="leader()" data-dfn-type="value" data-export id="valdef-leader-dotted">dotted</dfn> <dd>Equivalent to <span class="css">leader(".")</span> <dt><dfn class="dfn-paneled css" data-dfn-for="leader()" data-dfn-type="value" data-export id="valdef-leader-solid">solid</dfn> <dd>Equivalent to <span class="css">leader("_")</span> <dt><dfn class="dfn-paneled css" data-dfn-for="leader()" data-dfn-type="value" data-export id="valdef-leader-space">space</dfn> <dd>Equivalent to <span class="css">leader(" ")</span> <dt><dfn class="dfn-paneled css" data-dfn-for="leader()" data-dfn-type="value" data-export id="valdef-leader-string"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value①①">&lt;string></a></dfn> <dd> Issue: Define this. </dl> <div class="example" id="example-e0047436"> <a class="self-link" href="#example-e0047436"></a> <pre class="highlight">ol.toc a::after <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- nf>leader</c-><c- p>(</c-><c- s>'.'</c-><c- p>)</c-> <c- nf>target-counter</c-><c- p>(</c-><c- nf>attr</c-><c- p>(</c->href<c- p>),</c-> page<c- p>);</c-> <c- p>}</c-> &lt;h1>Table of Contents&lt;/h1> &lt;ol class=<c- s>"toc"</c->> &lt;li>&lt;a href=<c- s>"#chapter1"</c->>Loomings&lt;/a>&lt;/li> &lt;li>&lt;a href=<c- s>"#chapter2"</c->>The Carpet-Bag&lt;/a>&lt;/li> &lt;li>&lt;a href=<c- s>"#chapter3"</c->>The Spouter-Inn&lt;/a>&lt;/li> &lt;/ol> </pre> <p>This might result in:</p> <pre class="highlight">Table of Contents <c- m>1</c->. Loomings....................<c- m>.1</c-> <c- m>2</c->. The Carpet-Bag..............<c- m>.9</c-> <c- m>3</c->. The Spouter-Inn............<c- m>.13</c-> </pre> </div> <p class="issue" id="issue-2f5c8d3f"><a class="self-link" href="#issue-2f5c8d3f"></a> Do leaders depend on the assumption that the content after the leader is right-aligned (end-aligned)?</p> <h4 class="heading settled" data-level="2.5.2" id="leader-rules"><span class="secno">2.5.2. </span><span class="content"> Rendering leaders</span><a class="self-link" href="#leader-rules"></a></h4> <p>Consider a line which contains the content before the leader (the “before content”), the leader, and the content after the leader (the “after content”). Leaders obey the following rules:</p> <ol> <li data-md> <p>The leader string must appear in full at least once.</p> <li data-md> <p>The leader should be as long as possible</p> <li data-md> <p>Visible characters in leaders should vertically align with each other when possible.</p> <li data-md> <p>Line break characters in the leader string must be ignored.</p> <li data-md> <p>White space in the leader string follows normal CSS rules.</p> <li data-md> <p>A leader only appears between the start content and the end content.</p> <li data-md> <p>A leader only appears on a single line, even if the before content and after content are on different lines.</p> <li data-md> <p>A leader can’t be the only thing on a line.</p> </ol> <h4 class="heading settled" data-level="2.5.3" id="leader-alignment"><span class="secno">2.5.3. </span><span class="content"> Procedure for rendering leaders</span><a class="self-link" href="#leader-alignment"></a></h4> <ol> <li data-md> <p>Lay out the <var>before content</var>, until reaching the line where the <var>before content</var> ends.</p> <pre class="highlight">BBBBBBBBBB BBB </pre> <li data-md> <p>The leader string consists of one or more glyphs, and is thus an inline box. A leader is a row of these boxes, drawn from the end edge to the start edge, where only those boxes not overlaid by the before or after content. On this line, draw the leader string, starting from the end edge, repeating as many times as possible until reaching the start edge.</p> <pre class="highlight">BBBBBBBBBB .......... </pre> <li data-md> <p>Draw the before and after content on top of the leader. If any part of the <var>before content</var> or <var>after content</var> overlaps a glyph in a leader string box, that glyph is not displayed.</p> <pre class="highlight">BBBBBBBBBB BBB....AAA </pre> <li data-md> <p>If one full copy of the leader string is not visible:</p> <pre class="highlight">BBBBBBB BBBBBBA </pre> <p>Insert a line break after the <var>before content</var>, draw the leader on the next line, and draw the <var>after content</var> on top, and hide any leader strings that are not fully displayed.</p> <pre class="highlight">BBBBBBB BBBBBB ......A </pre> </ol> <p class="issue" id="issue-449754e4"><a class="self-link" href="#issue-449754e4"></a> what to do if <var>after content</var> is wider than the line box?</p> <p class="issue" id="issue-bb18b3e4"><a class="self-link" href="#issue-bb18b3e4"></a> Leaders don’t quite work in table layouts. How can we fix this?</p> <figure> <img alt="drawing leaders" src="images/leader.001.jpg" width="480"> <figcaption>Procedure for drawing leaders</figcaption> </figure> <figure> <img alt="drawing leaders" src="images/leader.002.jpg" width="480"> <figcaption>Procedure for drawing leaders when the content doesn’t fit on a single line</figcaption> </figure> <h3 class="heading settled" data-level="2.6" id="cross-references"><span class="secno">2.6. </span><span class="content"> Cross References</span><a class="self-link" href="#cross-references"></a></h3> <p>Many documents contain internal references:</p> <div class="example" id="example-33585682"> <a class="self-link" href="#example-33585682"></a> <ul> <li data-md> <p>See chapter 7</p> <li data-md> <p>in section 4.1</p> <li data-md> <p>on page 23</p> </ul> </div> <p>Three new values for the content property are used to automatically create these types of cross-references: <a class="css" data-link-type="maybe" href="#funcdef-target-counter" id="ref-for-funcdef-target-counter">target-counter()</a>, <a class="css" data-link-type="maybe" href="#funcdef-target-counters" id="ref-for-funcdef-target-counters">target-counters()</a>, and <a class="css" data-link-type="maybe" href="#target-text-function" id="ref-for-target-text-function">target-text()</a>. Each of these displays information obtained from the target end of a link.</p> <pre class="prod highlight"><dfn class="dfn-paneled" data-dfn-type="type" data-export id="typedef-target"><a class="production" data-link-type="type" href="#typedef-target" id="ref-for-typedef-target①">&lt;target></a></dfn> = <a class="production" data-link-type="function" href="#funcdef-target-counter" id="ref-for-funcdef-target-counter①">&lt;<c- nf>target-counter</c-><c- p>()</c->></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②③">|</a> <a class="production" data-link-type="function" href="#funcdef-target-counters" id="ref-for-funcdef-target-counters①">&lt;<c- nf>target-counters</c-><c- p>()</c->></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②④">|</a> <a class="production" data-link-type="function" href="#target-text-function" id="ref-for-target-text-function①">&lt;<c- nf>target-text</c-><c- p>()</c->></a> </pre> <p>See sections below for details on each of these.</p> <h4 class="heading settled" data-level="2.6.1" id="target-counter"><span class="secno">2.6.1. </span><span class="content"> The <a class="css" data-link-type="maybe" href="#funcdef-target-counter" id="ref-for-funcdef-target-counter②">target-counter()</a> function</span><a class="self-link" href="#target-counter"></a></h4> <pre class="prod highlight"><dfn class="dfn-paneled" data-dfn-type="function" data-export id="funcdef-target-counter"><c- nf>target-counter</c-><c- p>()</c-></dfn> = <c- nf>target-counter</c-><c- p>(</c-> <c- p>[</c-> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value①②">&lt;string></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②⑤">|</a> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#url-value" id="ref-for-url-value">&lt;url></a> <c- p>]</c-> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma"><c- p>,</c-></a> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#identifier-value" id="ref-for-identifier-value">&lt;custom-ident></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma①"><c- p>,</c-></a> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-counter-styles-3/#typedef-counter-style" id="ref-for-typedef-counter-style">&lt;counter-style></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt①">?</a> <c- p>)</c-> </pre> <p>The <a class="css" data-link-type="maybe" href="#funcdef-target-counter" id="ref-for-funcdef-target-counter③">target-counter()</a> function retrieves the value of the innermost counter with a given name. The required arguments are the url of the target and the name of the counter. An optional counter-style argument can be used to format the result.</p> <p>These functions only take a fragment URL which points to a location in the current document. If there’s no fragment, if the ID referenced isn’t there, or if the URL points to an outside document, the user agent must treat that as an error.</p> <p class="issue" id="issue-7443dd19"><a class="self-link" href="#issue-7443dd19"></a> what should error handling be?</p> <p class="issue" id="issue-2b2bd98b"><a class="self-link" href="#issue-2b2bd98b"></a> restrict syntactically to local references for now.</p> <div class="example" id="example-a3b9f868"> <a class="self-link" href="#example-a3b9f868"></a> HTML: <pre class="highlight">…which will be discussed on page &lt;a href=<c- s>"#chapter4_sec2"</c->>&lt;/a>. </pre> <p>CSS:</p> <pre class="highlight"><c- k>a</c-><c- p>:</c->:after <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- nf>target-counter</c-><c- p>(</c-><c- nf>attr</c-><c- p>(</c->href url<c- p>),</c-> page<c- p>)</c-> <c- p>}</c-> </pre> <p>Result:</p> <pre class="highlight">…which will be discussed on page <c- m>137</c->. </pre> </div> <div class="example" id="example-61dcfb19"> <a class="self-link" href="#example-61dcfb19"></a> Page numbers in tables of contents can be generated automatically: <p>HTML:</p> <pre class="highlight">&lt;nav> &lt;ol> &lt;li class=<c- s>"frontmatter"</c->>&lt;a href=<c- s>"#pref_01"</c->>Preface&lt;/a>&lt;/li> &lt;li class=<c- s>"frontmatter"</c->>&lt;a href=<c- s>"#intr_01"</c->>Introduction&lt;/a>&lt;/li> &lt;li class=<c- s>"bodymatter"</c->>&lt;a href=<c- s>"#chap_01"</c->>Chapter One&lt;/a>&lt;/li> &lt;/ol> &lt;/nav> </pre> <p>CSS:</p> <pre class="highlight">.frontmatter a::after <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- nf>leader</c-><c- p>(</c-><c- s>'.'</c-><c- p>)</c-> <c- nf>target-counter</c-><c- p>(</c-><c- nf>attr</c-><c- p>(</c->href url<c- p>),</c-> page<c- p>,</c-> lower-roman<c- p>)</c-> <c- p>}</c-> .bodymatter a::after <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- nf>leader</c-><c- p>(</c-><c- s>'.'</c-><c- p>)</c-> <c- nf>target-counter</c-><c- p>(</c-><c- nf>attr</c-><c- p>(</c->href url<c- p>),</c-> page<c- p>,</c-> decimal<c- p>)</c-> <c- p>}</c-> </pre> <p>Result:</p> <pre class="highlight">Preface.............vii Introduction.........xi Chapter One..........<c- m>.1</c-> </pre> </div> <h4 class="heading settled" data-level="2.6.2" id="target-counters"><span class="secno">2.6.2. </span><span class="content"> The <a class="css" data-link-type="maybe" href="#funcdef-target-counters" id="ref-for-funcdef-target-counters②">target-counters()</a> function </span><a class="self-link" href="#target-counters"></a></h4> <p>This functions fetches the value of all counters of a given name from the end of a link, and formats them by inserting a given string between the value of each nested counter.</p> <pre class="prod highlight"><dfn class="dfn-paneled" data-dfn-type="function" data-export id="funcdef-target-counters"><c- nf>target-counters</c-><c- p>()</c-></dfn> = <c- nf>target-counters</c-><c- p>(</c-> <c- p>[</c-> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value①③">&lt;string></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②⑥">|</a> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#url-value" id="ref-for-url-value①">&lt;url></a> <c- p>]</c-> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma②"><c- p>,</c-></a> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#identifier-value" id="ref-for-identifier-value①">&lt;custom-ident></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma③"><c- p>,</c-></a> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value①④">&lt;string></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma④"><c- p>,</c-></a> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-counter-styles-3/#typedef-counter-style" id="ref-for-typedef-counter-style①">&lt;counter-style></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt②">?</a> <c- p>)</c-> </pre> <div class="example" id="example-00974551"> <a class="self-link" href="#example-00974551"></a> <pre class="highlight">I have not found a compelling example for <c- nf>target-counters</c-><c- p>()</c-> yet. </pre> <p class="issue" id="issue-6e7203db"><a class="self-link" href="#issue-6e7203db"></a> found a compelling example, in CSS specs. Do something.</p> </div> <h4 class="heading settled" data-level="2.6.3" id="target-text"><span class="secno">2.6.3. </span><span class="content"> The <a class="css" data-link-type="maybe" href="#target-text-function" id="ref-for-target-text-function②">target-text()</a> function</span><a class="self-link" href="#target-text"></a></h4> <p>The <a class="css" data-link-type="maybe" href="#target-text-function" id="ref-for-target-text-function③">target-text()</a> function retrieves the text value of the element referred to by the URL. An optional second argument specifies what content is retrieved, using the same values as the <a class="property css" data-link-type="property" href="#propdef-string-set" id="ref-for-propdef-string-set">string-set</a> property above.</p> <pre class="prod highlight"><dfn class="dfn-paneled" data-dfn-type="function" data-export id="target-text-function"><c- nf>target-text</c-><c- p>()</c-></dfn> = <c- nf>target-text</c-><c- p>(</c-> <c- p>[</c-> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value①⑤">&lt;string></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②⑦">|</a> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#url-value" id="ref-for-url-value②">&lt;url></a> <c- p>]</c-> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma⑤"><c- p>,</c-></a> <c- p>[</c-> content <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②⑧">|</a> before <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one②⑨">|</a> after <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one③⓪">|</a> first-letter <c- p>]</c-><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt③">?</a> <c- p>)</c-> </pre> <p class="issue" id="issue-a82075c9"><a class="self-link" href="#issue-a82075c9"></a> A simpler syntax has been proposed by fantasai: <a href="http://lists.w3.org/Archives/Public/www-style/2012Feb/0745.html">http://lists.w3.org/Archives/Public/www-style/2012Feb/0745.html</a></p> <div class="example" id="example-d5ce9fa3"> <a class="self-link" href="#example-d5ce9fa3"></a> <pre class="highlight">…which will be discussed &lt;a href=<c- s>"#chapter_h1_1"</c->>later&lt;/a>. a::after <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- s>", in the chapter entitled "</c-> <c- nf>target-text</c-><c- p>(</c-><c- nf>attr</c-><c- p>(</c->href url<c- p>))</c-> <c- p>}</c-> </pre> <p>Result: …which will be discussed later, in the chapter entitled Loomings.</p> </div> <h3 class="heading settled" data-level="2.7" id="named-strings"><span class="secno">2.7. </span><span class="content"> Named Strings</span><a class="self-link" href="#named-strings"></a></h3> <p>This section introduces <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="named string" data-noexport id="named-string">named strings</dfn>, which are the textual equivalent of counters and which have a distinct namespace from counters. Named strings follow the same nesting rules as counters. The <a class="property css" data-link-type="property" href="#propdef-string-set" id="ref-for-propdef-string-set①">string-set</a> property accepts values similar to the <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content①⑤">content</a> property, including the extraction of the current value of counters.</p> <p>Named strings are a convenient way to pull metadata out of the document for insertion into headers and footers. In HTML, for example, META elements contained in the document HEAD can set the value of named strings. In conjunction with attribute selectors, this can be a powerful mechanism:</p> <div class="example" id="example-208227c0"> <a class="self-link" href="#example-208227c0"></a> <pre class="highlight">meta<c- p>[</c->author<c- p>]</c-> <c- p>{</c-> <c- k>string-set</c-><c- p>:</c-> author <c- nf>attr</c-><c- p>(</c->author<c- p>);</c-> <c- p>}</c-> head > title <c- p>{</c-> <c- k>string-set</c-><c- p>:</c-> title contents<c- p>;</c-> <c- p>}</c-> <c- n>@page</c->:left <c- p>{</c-> <c- n>@top</c-> <c- p>{</c-> <c- k>text-align</c-><c- p>:</c-> left<c- p>;</c-> <c- k>vertical-align</c-><c- p>:</c-> middle<c- p>;</c-> <c- k>content</c-><c- p>:</c-> <c- nf>string</c-><c- p>(</c->title<c- p>);</c-> <c- p>}</c-> <c- p>}</c-> <c- n>@page</c->:right <c- p>{</c-> <c- n>@top</c-> <c- p>{</c-> <c- k>text-align</c-><c- p>:</c-> right<c- p>;</c-> <c- k>vertical-align</c-><c- p>:</c-> middle<c- p>;</c-> <c- k>content</c-><c- p>:</c-> <c- nf>string</c-><c- p>(</c->author<c- p>);</c-> <c- p>}</c-> <c- p>}</c-> </pre> </div> <h4 class="heading settled" data-level="2.7.1" id="string-set"><span class="secno">2.7.1. </span><span class="content"> Naming Strings: the <a class="property css" data-link-type="property" href="#propdef-string-set" id="ref-for-propdef-string-set②">string-set</a> property</span><a class="self-link" href="#string-set"></a></h4> <table class="def propdef" data-link-for-hint="string-set"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-string-set">string-set</dfn> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">Value:</a> <td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one③①">|</a> [ <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#identifier-value" id="ref-for-identifier-value②">&lt;custom-ident></a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value①⑥">&lt;string></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-one-plus" id="ref-for-mult-one-plus③">+</a> ]<a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-comma" id="ref-for-mult-comma">#</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a> <td>none <tr> <th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a> <td>all elements, but not pseudo-elements <tr> <th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://www.w3.org/TR/css-values/#percentages">Percentages:</a> <td>N/A <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>the keyword <a class="css" data-link-type="maybe" href="#valdef-string-set-none" id="ref-for-valdef-string-set-none">none</a> or a list, each item an identifier paired with a list of string values <tr> <th><a href="https://www.w3.org/TR/cssom/#serializing-css-values">Canonical order:</a> <td>per grammar <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>discrete </table> <p class="all-media">User agents are expected to support this property on all media, including non-visual ones.</p> <p>The <a class="property css" data-link-type="property" href="#propdef-string-set" id="ref-for-propdef-string-set③">string-set</a> property copies the text content of an element into a <span class="css">named string</span>, which functions as a variable. The text content of this named string can be retrieved using the <a class="css" data-link-type="maybe" href="#funcdef-string" id="ref-for-funcdef-string①">string()</a> function. Since these variables may change on a given page, an optional second value for the <span class="css" id="ref-for-funcdef-string②">string()</span> function allows authors to choose which value on a page is used.</p> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="string-set" data-dfn-type="value" data-export id="valdef-string-set-none">none</dfn> <dd> The element does not set any named strings. <dt><code class="highlight"><c- p>[</c-> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#identifier-value" id="ref-for-identifier-value③">&lt;custom-ident></a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value①⑦">&lt;string></a>+ <c- p>]</c->#</code> <dd> The element establishes one or more named strings, corresponding to each comma-separated entry in the list. <p>For each entry, the <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#identifier-value" id="ref-for-identifier-value④">&lt;custom-ident></a> gives the name of the named string. It’s followed by one or more <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#string-value" id="ref-for-string-value①⑧">&lt;string></a> values, which are concatenated together to form the value of the named string.</p> </dl> <p>If an element has <a data-link-type="dfn" href="https://drafts.csswg.org/css-contain-2/#style-containment" id="ref-for-style-containment">style containment</a>, the <a class="property css" data-link-type="property" href="#propdef-string-set" id="ref-for-propdef-string-set④">string-set</a> property must have no effects on descendants of that element.</p> <div class="example" id="example-ebda2d09"> <a class="self-link" href="#example-ebda2d09"></a> The following example captures the contents of H1 elements, which represent chapter names in this hypothetical document. <pre class="highlight">H1 <c- p>{</c-> <c- k>string-set</c-><c- p>:</c-> chapter contents<c- p>;</c-> <c- p>}</c-></pre> <p>When an H1 element is encountered, the <span class="css">chapter</span> string is set to the element’s textual contents, and the previous value of <span class="css">chapter</span>, if any, is overwritten.</p> </div> <h4 class="heading settled" data-level="2.7.2" id="string-function"><span class="secno">2.7.2. </span><span class="content"> Inserting Named Strings: the <a class="css" data-link-type="maybe" href="#funcdef-string" id="ref-for-funcdef-string③">string()</a> function</span><a class="self-link" href="#string-function"></a></h4> <pre class="prod highlight"><dfn class="dfn-paneled" data-dfn-type="function" data-export id="funcdef-string"><c- nf>string</c-><c- p>()</c-></dfn> = <c- nf>string</c-><c- p>(</c-> <a class="production" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#identifier-value" id="ref-for-identifier-value⑤">&lt;custom-ident></a> <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-comma" id="ref-for-comb-comma⑥"><c- p>,</c-></a> <c- p>[</c-> first <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one③②">|</a> start <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one③③">|</a> last <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one③④">|</a> first-except <c- p>]</c-><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt④">?</a> <c- p>)</c-> </pre> <p>The <a class="css" data-link-type="maybe" href="#funcdef-string" id="ref-for-funcdef-string④">string()</a> function is used to copy the value of a named string to the document, via the <a class="property css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content①⑥">content</a> property. This function requires one argument, the name of the named string. Since the value of a named string may change several times on a page (as multiple elements defining the string can appear) an optional second argument indicates which value of the named string should be used.</p> <p>The second argument of the <a class="css" data-link-type="maybe" href="#funcdef-string" id="ref-for-funcdef-string⑤">string()</a> function is one of the following keywords:</p> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="string()" data-dfn-type="value" data-export id="valdef-string-first">first</dfn> <dd> The value of the first assignment on the page is used. If there is no assignment on the page, the <a data-link-type="dfn" href="#entry-value" id="ref-for-entry-value">entry value</a> is used. If no second argument is provided, this is the default value. <dt><dfn class="dfn-paneled css" data-dfn-for="string()" data-dfn-type="value" data-export id="valdef-string-start">start</dfn> <dd> If the element is the first element on the page, the value of the first assignment is used. Otherwise the <a data-link-type="dfn" href="#entry-value" id="ref-for-entry-value①">entry value</a> is used. The <span id="ref-for-entry-value②">entry value</span> may be empty if the <a data-link-type="dfn" href="#named-string" id="ref-for-named-string">named string</a> hasn’t yet appeared. <dt><dfn class="dfn-paneled css" data-dfn-for="string()" data-dfn-type="value" data-export id="valdef-string-last">last</dfn> <dd> The <a data-link-type="dfn" href="#exit-value" id="ref-for-exit-value">exit value</a> of the named string is used. <dt><dfn class="dfn-paneled css" data-dfn-for="string()" data-dfn-type="value" data-export id="valdef-string-first-except">first-except</dfn> <dd> This is identical to <a class="css" data-link-type="maybe" href="#valdef-string-first" id="ref-for-valdef-string-first">first</a>, except that the empty string is used on the page where the value is assigned. <p class="issue" id="issue-c24bc3d7"><a class="self-link" href="#issue-c24bc3d7"></a> we may need to kill the entire content string. Is this necessary?</p> </dl> <p>The content values of named strings are assigned at the point when the content box of the element is first created (or would have been created if the element’s display value is none). The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="entry-value">entry value</dfn> for a page is the assignment in effect at the end of the previous page. The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="exit-value">exit value</dfn> for a page is the assignment in effect at the end of the current page.</p> <div class="example" id="example-23e3824c"> <a class="self-link" href="#example-23e3824c"></a> CSS: <pre class="highlight"><c- n>@page</c-> <c- p>{</c-> <c- k>size</c-><c- p>:</c-> <c- m>15</c-><c- k>cm</c-> <c- m>10</c-><c- k>cm</c-><c- p>;</c-> <c- k>margin</c-><c- p>:</c-> <c- m>1.5</c-><c- k>cm</c-><c- p>;</c-> <c- n>@top-left</c-> <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- s>"first: "</c-> <c- nf>string</c-><c- p>(</c->heading<c- p>,</c-> first<c- p>);</c-> <c- p>}</c-> <c- n>@top-center</c-> <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- s>"start: "</c-> <c- nf>string</c-><c- p>(</c->heading<c- p>,</c-> start<c- p>);</c-> <c- p>}</c-> <c- n>@top-right</c-> <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- s>"last: "</c-> <c- nf>string</c-><c- p>(</c->heading<c- p>,</c-> last<c- p>);</c-> <c- p>}</c-> <c- p>}</c-> h2 <c- p>{</c-> <c- k>string-set</c-><c- p>:</c-> heading <c- nf>content</c-><c- p>()</c-> <c- p>}</c-> </pre> <p>The following figures show the first, start, and last assignments of the “heading” string on various pages.</p> <figure> <img alt src="images/using-strings-1.jpg" width="480"> <figcaption>The <span class="css">start</span> value is empty, as the string had not yet been set at the start of the page.</figcaption> </figure> <figure> <img alt src="images/using-strings-2.jpg" width="480"> <figcaption>Since the page starts with an h2, the <span class="css">start</span> value is the value of that head.</figcaption> </figure> <figure> <img alt src="images/using-strings-3.jpg" width="480"> <figcaption>Since there’s not an h2 at the top of this page, the <span class="css">start</span> value is the <a data-link-type="dfn" href="#exit-value" id="ref-for-exit-value①">exit value</a> of the previous page.</figcaption> </figure> </div> <h4 class="heading settled" data-level="2.7.3" id="content-function"><span class="secno">2.7.3. </span><span class="content"> The <a class="css" data-link-type="maybe" href="#funcdef-content" id="ref-for-funcdef-content②">content()</a> function</span><a class="self-link" href="#content-function"></a></h4> <pre class="prod highlight"><dfn class="dfn-paneled" data-dfn-type="function" data-export id="funcdef-content"><c- nf>content</c-><c- p>()</c-></dfn> = <c- nf>content</c-><c- p>(</c-> <c- p>[</c-> text <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one③⑤">|</a> before <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one③⑥">|</a> after <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one③⑦">|</a> first-letter <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one③⑧">|</a> marker <c- p>]</c-><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-opt" id="ref-for-mult-opt⑤">?</a> <c- p>)</c-> </pre> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="content()" data-dfn-type="value" data-export id="valdef-content-text">text</dfn> <dd>The string value of the element. If no value is specified in <a class="css" data-link-type="maybe" href="#funcdef-content" id="ref-for-funcdef-content③">content()</a>, it acts as if <a class="css" data-link-type="maybe" href="#valdef-content-text" id="ref-for-valdef-content-text">text</a> were specified. <dt><dfn class="dfn-paneled css" data-dfn-for="content()" data-dfn-type="value" data-export id="valdef-content-before">before</dfn> <dd>The string value of the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-before" id="ref-for-selectordef-before③">::before</a> pseudo-element. <dt><dfn class="dfn-paneled css" data-dfn-for="content()" data-dfn-type="value" data-export id="valdef-content-after">after</dfn> <dd>The string value of the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-after" id="ref-for-selectordef-after③">::after</a> pseudo-element. <dt><dfn class="dfn-paneled css" data-dfn-for="content()" data-dfn-type="value" data-export id="valdef-content-first-letter">first-letter</dfn> <dd>The first letter of the element, as defined for the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-first-letter" id="ref-for-selectordef-first-letter">::first-letter</a> pseudo-element <dt><dfn class="dfn-paneled css" data-dfn-for="content()" data-dfn-type="value" data-export id="valdef-content-marker">marker</dfn> <dd>The string value of the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-marker" id="ref-for-selectordef-marker②">::marker</a> pseudo-element. </dl> <div class="example" id="example-e698ead2"> <a class="self-link" href="#example-e698ead2"></a> HTML: <pre class="highlight">&lt;h1>Loomings&lt;/h1> </pre> <p>CSS:</p> <pre class="highlight"><c- k>h1</c-><c- p>:</c->:before <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- s>'Chapter '</c-> <c- nf>counter</c-><c- p>(</c->chapter<c- p>);</c-> <c- p>}</c-> h1 <c- p>{</c-> <c- k>string-set</c-><c- p>:</c-> header <c- nf>content</c-><c- p>(</c->before<c- p>)</c-> <c- s>':'</c-> <c- nf>content</c-><c- p>(</c->text<c- p>);</c-> <c- p>}</c-> h1::after <c- p>{</c-> <c- k>content</c-><c- p>:</c-> <c- s>'.'</c-><c- p>;</c-> <c- p>}</c-> </pre> <p>The value of the named string “header” will be “Chapter 1: Loomings”.</p> </div> <div class="example" id="example-ba54cbec"> <a class="self-link" href="#example-ba54cbec"></a> HTML: <pre class="highlight">&lt;section title=<c- s>"Loomings"</c->> </pre> <p>CSS:</p> <pre class="highlight">section <c- p>{</c-> <c- k>string-set</c-><c- p>:</c-> header <c- nf>attr</c-><c- p>(</c->title<c- p>)</c-> <c- p>}</c-> </pre> <p>The value of the “header” string will be “Loomings”.</p> </div> <h3 class="heading settled" data-level="2.8" id="counters"><span class="secno">2.8. </span><span class="content"> Automatic Counters and Numbering</span><a class="self-link" href="#counters"></a></h3> <p>See <a href="https://drafts.csswg.org/css-lists-3/#auto-numbering"><cite>CSS Lists 3</cite> § 4 Automatic Numbering With Counters</a>.</p> <p class="issue" id="issue-0161c10e"><a class="self-link" href="#issue-0161c10e"></a> Should this move back to CSS Content?</p> <h2 class="heading settled" data-level="3" id="bookmark-generation"><span class="secno">3. </span><span class="content"> Bookmarks</span><a class="self-link" href="#bookmark-generation"></a></h2> <p>Some document formats, most notably PDF, allow the use of <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="bookmarks">bookmarks</dfn> as an aid to navigation. Bookmarks provide a list of links to document elements, as well as text to label the links and a level value. A bookmark has three properties: <a class="property css" data-link-type="property" href="#propdef-bookmark-level" id="ref-for-propdef-bookmark-level">bookmark-level</a>, <a class="property css" data-link-type="property" href="#propdef-bookmark-label" id="ref-for-propdef-bookmark-label">bookmark-label</a>, and <a class="property css" data-link-type="property" href="#propdef-bookmark-state" id="ref-for-propdef-bookmark-state">bookmark-state</a>.</p> <p>When a user activates a bookmark, the user agent must bring that reference point to the user’s attention, exactly as if navigating to that element by fragment URL. <span class="note">This will also trigger matching the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/selectors-4/#target-pseudo" id="ref-for-target-pseudo">:target</a> pseudo-class.</span></p> <p>If an element has <a data-link-type="dfn" href="https://drafts.csswg.org/css-contain-2/#style-containment" id="ref-for-style-containment①">style containment</a>, the <a class="property css" data-link-type="property" href="#propdef-bookmark-level" id="ref-for-propdef-bookmark-level①">bookmark-level</a>, <a class="property css" data-link-type="property" href="#propdef-bookmark-label" id="ref-for-propdef-bookmark-label①">bookmark-label</a>, and <a class="property css" data-link-type="property" href="#propdef-bookmark-state" id="ref-for-propdef-bookmark-state①">bookmark-state</a> properties must have no effect on descendants of the element.</p> <h3 class="heading settled" data-level="3.1" id="bookmark-level"><span class="secno">3.1. </span><span class="content"> Setting a Bookmark: the <a class="property css" data-link-type="property" href="#propdef-bookmark-level" id="ref-for-propdef-bookmark-level②">bookmark-level</a> property </span><a class="self-link" href="#bookmark-level"></a></h3> <p>The <a class="property css" data-link-type="property" href="#propdef-bookmark-level" id="ref-for-propdef-bookmark-level③">bookmark-level</a> property determines if a bookmark is created, and at what level. If this property is absent, or has value <a class="css" data-link-type="maybe" href="#valdef-bookmark-level-none" id="ref-for-valdef-bookmark-level-none">none</a>, no bookmark should be generated, regardless of the values of <a class="property css" data-link-type="property" href="#propdef-bookmark-label" id="ref-for-propdef-bookmark-label②">bookmark-label</a> or <a class="property css" data-link-type="property" href="#propdef-bookmark-state" id="ref-for-propdef-bookmark-state②">bookmark-state</a>.</p> <table class="def propdef" data-link-for-hint="bookmark-level"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-bookmark-level">bookmark-level</dfn> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">Value:</a> <td class="prod">none <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one③⑨">|</a> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#integer-value" id="ref-for-integer-value">&lt;integer [1,∞]></a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a> <td>none <tr> <th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a> <td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://www.w3.org/TR/css-values/#percentages">Percentages:</a> <td>N/A <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>the keyword <a class="css" data-link-type="maybe" href="#valdef-bookmark-level-none" id="ref-for-valdef-bookmark-level-none①">none</a> or the specified integer <tr> <th><a href="https://www.w3.org/TR/cssom/#serializing-css-values">Canonical order:</a> <td>per grammar <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>by computed value type </table> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="bookmark-level" data-dfn-type="value" data-export id="valdef-bookmark-level-integer-1"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-4/#integer-value" id="ref-for-integer-value①">&lt;integer [1,∞]></a></dfn> <dd>defines the level of the bookmark, with the top level being 1 (negative and zero values are invalid). <dt><dfn class="dfn-paneled css" data-dfn-for="bookmark-level" data-dfn-type="value" data-export id="valdef-bookmark-level-none">none</dfn> <dd>no bookmark is generated. </dl> <div class="example" id="example-dd8b2d49"> <a class="self-link" href="#example-dd8b2d49"></a> <pre class="highlight">section h1 <c- p>{</c-> <c- k>bookmark-level</c-><c- p>:</c-> <c- m>1</c-><c- p>;</c-> <c- p>}</c-> section section h1 <c- p>{</c-> <c- k>bookmark-level</c-><c- p>:</c-> <c- m>2</c-><c- p>;</c-> <c- p>}</c-> section section section h1 <c- p>{</c-> <c- k>bookmark-level</c-><c- p>:</c-> <c- m>3</c-><c- p>;</c-> <c- p>}</c-> </pre> </div> <p class="note" role="note"><span class="marker">Note:</span> Bookmarks do not need to create a strict hierarchy of levels.</p> <p class="issue" id="issue-de0f5f60"><a class="self-link" href="#issue-de0f5f60"></a> Should a bookmark be created for elements with <code class="highlight"><c- k>display</c-><c- p>:</c-> none</code>?</p> <h3 class="heading settled" data-level="3.2" id="bookmark-label"><span class="secno">3.2. </span><span class="content"> Labelling a Bookmark: the <a class="property css" data-link-type="property" href="#propdef-bookmark-label" id="ref-for-propdef-bookmark-label③">bookmark-label</a> property</span><a class="self-link" href="#bookmark-label"></a></h3> <table class="def propdef" data-link-for-hint="bookmark-label"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-bookmark-label">bookmark-label</dfn> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">Value:</a> <td class="prod"><a class="production css" data-link-type="type" href="#typedef-content-content-list" id="ref-for-typedef-content-content-list⑨">&lt;content-list></a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a> <td>content(text) <tr> <th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a> <td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a> <tr> <th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://www.w3.org/TR/css-values/#percentages">Percentages:</a> <td>N/A <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>specified value <tr> <th><a href="https://www.w3.org/TR/cssom/#serializing-css-values">Canonical order:</a> <td>per grammar <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>discrete </table> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="bookmark-label" data-dfn-type="value" data-export id="valdef-bookmark-label-content-list"><a class="production css" data-link-type="type" href="#typedef-content-content-list" id="ref-for-typedef-content-content-list①⓪">&lt;content-list></a></dfn> <dd><a class="production css" data-link-type="type" href="#typedef-content-content-list" id="ref-for-typedef-content-content-list①①">&lt;content-list></a> is defined above, in the section on the <a class="property css" data-link-type="property" href="#propdef-string-set" id="ref-for-propdef-string-set⑤">string-set</a> property. The value of <span class="production" id="ref-for-typedef-content-content-list①②">&lt;content-list></span> becomes the text content of the bookmark label. </dl> <div class="example" id="example-273659aa"> <a class="self-link" href="#example-273659aa"></a> HTML: <pre class="highlight">&lt;h1>Loomings&lt;/h1> </pre> <p>CSS:</p> <pre class="highlight">h1 <c- p>{</c-> <c- k>bookmark-label</c-><c- p>:</c-> <c- nf>content</c-><c- p>(</c->text<c- p>);</c-> <c- k>bookmark-level</c-><c- p>:</c-> <c- m>1</c-><c- p>;</c-> <c- p>}</c-> </pre> <p>The bookmark label will be “Loomings”.</p> </div> <h3 class="heading settled" data-level="3.3" id="bookmark-state"><span class="secno">3.3. </span><span class="content"> Initial Bookmark Toggle State: the <a class="property css" data-link-type="property" href="#propdef-bookmark-state" id="ref-for-propdef-bookmark-state③">bookmark-state</a> property</span><a class="self-link" href="#bookmark-state"></a></h3> <p>The <a class="property css" data-link-type="property" href="#propdef-bookmark-state" id="ref-for-propdef-bookmark-state④">bookmark-state</a> may be open or closed. The user must be able to toggle the bookmark state.</p> <table class="def propdef" data-link-for-hint="bookmark-state"> <tbody> <tr> <th>Name: <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-bookmark-state">bookmark-state</dfn> <tr class="value"> <th><a href="https://www.w3.org/TR/css-values/#value-defs">Value:</a> <td class="prod">open <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one④⓪">|</a> closed <tr> <th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a> <td>open <tr> <th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a> <td>block-level elements <tr> <th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a> <td>no <tr> <th><a href="https://www.w3.org/TR/css-values/#percentages">Percentages:</a> <td>N/A <tr> <th><a href="https://www.w3.org/TR/css-cascade/#computed">Computed value:</a> <td>specified keyword <tr> <th><a href="https://www.w3.org/TR/cssom/#serializing-css-values">Canonical order:</a> <td>per grammar <tr> <th><a href="https://www.w3.org/TR/web-animations/#animation-type">Animation type:</a> <td>discrete </table> <dl> <dt><dfn class="dfn-paneled css" data-dfn-for="bookmark-state" data-dfn-type="value" data-export id="valdef-bookmark-state-open">open</dfn> <dd> Subsequent bookmarks with <a class="property css" data-link-type="property" href="#propdef-bookmark-level" id="ref-for-propdef-bookmark-level④">bookmark-level</a> greater than the given bookmark are displayed, until reaching another bookmark of the same level or lower. If one of subsequent bookmark is closed, apply the same test to determine if its subsequent bookmarks should be displayed. <dt><dfn class="dfn-paneled css" data-dfn-for="bookmark-state" data-dfn-type="value" data-export id="valdef-bookmark-state-closed">closed</dfn> <dd> Subsequent bookmarks of bookmark-level greater than the given bookmark are not displayed, until reaching another bookmark of the same level or lower. </dl> <p class="issue" id="issue-be5a86f5"><a class="self-link" href="#issue-be5a86f5"></a> Is the initial bookmark state, or the bookmark state updated by the UA as appropriate?</p> <h2 class="heading settled" data-level="4" id="changes"><span class="secno">4. </span><span class="content">Changes</span><a class="self-link" href="#changes"></a></h2> <p>Significant changes since the <a href="https://www.w3.org/TR/2019/WD-css-content-3-20190802/">2 August 2019 Working Draft</a> consist primarily of:</p> <ul> <li>Updated <a class="css" data-link-type="maybe" href="#valdef-quotes-auto" id="ref-for-valdef-quotes-auto③">auto</a> to reference the <em>parent</em> <a data-link-type="dfn" href="https://drafts.csswg.org/css-text-4/#content-language" id="ref-for-content-language②">content language</a> rather than the <span id="ref-for-content-language③">content language</span> of the element itself. (<a href="https://github.com/w3c/csswg-drafts/issues/5478">Issue 5478</a>) <li>Added <a class="css" data-link-type="maybe" href="#valdef-quotes-match-parent" id="ref-for-valdef-quotes-match-parent①">match-parent</a> value to <a class="property css" data-link-type="property" href="#propdef-quotes" id="ref-for-propdef-quotes④">quotes</a>. (<a href="https://github.com/w3c/csswg-drafts/issues/5478">Issue 5478</a>) <li>Prevent negative <a data-link-type="dfn" href="#quote-depth" id="ref-for-quote-depth③">quote depth</a> by ignoring excess closing quotes, consistent with <a data-link-type="biblio" href="#biblio-css2" title="Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification">[CSS2]</a>. (<a href="https://github.com/w3c/csswg-drafts/issues/2038">Issue 2034</a>) <li>Defined computed value of <a class="css" data-link-type="propdesc" href="#propdef-content" id="ref-for-propdef-content①⑦">content: normal</a> for <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-placeholder" id="ref-for-selectordef-placeholder①">::placeholder</a> and <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-file-selector-button" id="ref-for-selectordef-file-selector-button①">::file-selector-button</a>. (<a href="https://github.com/w3c/csswg-drafts/issues/6124">Issue 6124</a>) <li>Fixed an off-by-one error for the <a data-link-type="dfn" href="#quote-depth" id="ref-for-quote-depth④">quote depth</a> of closing quotes. (<a href="https://github.com/w3c/csswg-drafts/issues/2506">Issue 2506</a>) <li>Inlined the definition of <span class="css">attr()</span>, since it has been dropped from <a data-link-type="biblio" href="#biblio-css-values-4" title="CSS Values and Units Module Level 4">[CSS-VALUES-4]</a>. <li>Miscellaneous editorial spec clean up. </ul> <p>See also <a href="https://www.w3.org/TR/2019/WD-css-content-3-20190802/#changes">previous changes</a>.</p> <h2 class="no-num heading settled" id="acknowledgements"><span class="content">Acknowledgements</span><a class="self-link" href="#acknowledgements"></a></h2> <p>Stuart Ballard, David Baron, Bert Bos, <span lang="tr">Tantek Çelik</span>, and James Craig provided invaluable suggestions used in this specification.</p> <h2 class="no-num heading settled" id="privacy"><span class="content">Privacy Considerations</span><a class="self-link" href="#privacy"></a></h2> <p>No new privacy considerations have been reported on this specification.</p> <h2 class="no-num heading settled" id="security"><span class="content">Security Considerations</span><a class="self-link" href="#security"></a></h2> <p>No new security considerations have been reported on this specification.</p> </main> <h2 class="no-ref no-num heading settled" id="w3c-conformance"><span class="content"> Conformance</span><a class="self-link" href="#w3c-conformance"></a></h2> <h3 class="no-ref heading settled" id="w3c-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#w3c-conventions"></a></h3> <p>Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification. </p> <p>All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119" title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</a></p> <p>Examples in this specification are introduced with the words “for example” or are set apart from the normative text with <code class="highlight">class=<c- s>"example"</c-></code>, like this: </p> <div class="example" id="w3c-example"> <a class="self-link" href="#w3c-example"></a> <p>This is an example of an informative example.</p> </div> <p>Informative notes begin with the word “Note” and are set apart from the normative text with <code class="highlight">class=<c- s>"note"</c-></code>, like this: </p> <p class="note" role="note">Note, this is an informative note.</p> <p>Advisements are normative sections styled to evoke special attention and are set apart from other normative text with <code class="highlight">&lt;strong class=<c- s>"advisement"</c->></code>, like this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong></p> <details class="wpt-tests-block" dir="ltr" lang="en" open> <summary>Tests</summary> <p>Tests relating to the content of this specification may be documented in “Tests” blocks like this one. Any such block is non-normative.</p> <ul class="wpt-tests-list"></ul> <hr> </details> <h3 class="no-ref heading settled" id="w3c-conformance-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#w3c-conformance-classes"></a></h3> <p>Conformance to this specification is defined for three conformance classes: </p> <dl> <dt>style sheet <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#style-sheet">CSS style sheet</a>. <dt>renderer <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders documents that use them. <dt>authoring tool <dd>A <a href="http://www.w3.org/TR/CSS21/conform.html#user-agent">UA</a> that writes a style sheet. </dl> <p>A style sheet is conformant to this specification if all of its statements that use syntax defined in this module are valid according to the generic CSS grammar and the individual grammars of each feature defined in this module. </p> <p>A renderer is conformant to this specification if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the features defined by this specification by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.) </p> <p>An authoring tool is conformant to this specification if it writes style sheets that are syntactically correct according to the generic CSS grammar and the individual grammars of each feature in this module, and meet all other conformance requirements of style sheets as described in this module. </p> <h3 class="no-ref heading settled" id="w3c-partial"><span class="content"> Partial implementations</span><a class="self-link" href="#w3c-partial"></a></h3> <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers <strong>must</strong> treat as invalid (and <a href="http://www.w3.org/TR/CSS21/conform.html#ignore">ignore as appropriate</a>) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. In particular, user agents <strong>must not</strong> selectively ignore unsupported component values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored.</p> <h4 class="heading settled" id="w3c-conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#w3c-conform-future-proofing"></a></h4> <p>To avoid clashes with future stable CSS features, the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p> <h3 class="no-ref heading settled" id="w3c-testing"><span class="content"> Non-experimental implementations</span><a class="self-link" href="#w3c-testing"></a></h3> <p>Once a specification reaches the Candidate Recommendation stage, non-experimental implementations are possible, and implementors should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec. </p> <p>To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group. </p> <p>Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>. Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list.</p> <script src="https://www.w3.org/scripts/TR/2021/fixup.js"></script> <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2> <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3> <ul class="index"> <li><a href="#valdef-content-after">after</a><span>, in § 2.7.3</span> <li><a href="#valdef-content-attr">attr()</a><span>, in § 2.1</span> <li><a href="#valdef-quotes-auto">auto</a><span>, in § 2.4.1</span> <li><a href="#valdef-content-before">before</a><span>, in § 2.7.3</span> <li><a href="#propdef-bookmark-label">bookmark-label</a><span>, in § 3.2</span> <li><a href="#propdef-bookmark-level">bookmark-level</a><span>, in § 3.1</span> <li><a href="#bookmarks">bookmarks</a><span>, in § 3</span> <li><a href="#propdef-bookmark-state">bookmark-state</a><span>, in § 3.3</span> <li><a href="#valdef-bookmark-state-closed">closed</a><span>, in § 3.3</span> <li><a href="#valdef-content-close-quote">close-quote</a><span>, in § 2.4.2</span> <li><a href="#propdef-content">content</a><span>, in § 1</span> <li><a href="#funcdef-content">content()</a><span>, in § 2.7.3</span> <li> &lt;content-list> <ul> <li><a href="#typedef-content-content-list">type for content</a><span>, in § 1</span> <li><a href="#valdef-bookmark-label-content-list">value for bookmark-label</a><span>, in § 3.2</span> </ul> <li><a href="#typedef-content-content-replacement">&lt;content-replacement></a><span>, in § 1</span> <li><a href="#valdef-content-contents">contents</a><span>, in § 2.3</span> <li><a href="#valdef-leader-dotted">dotted</a><span>, in § 2.5.1</span> <li><a href="#entry-value">entry value</a><span>, in § 2.7.2</span> <li><a href="#exit-value">exit value</a><span>, in § 2.7.2</span> <li><a href="#valdef-string-first">first</a><span>, in § 2.7.2</span> <li><a href="#valdef-string-first-except">first-except</a><span>, in § 2.7.2</span> <li><a href="#valdef-content-first-letter">first-letter</a><span>, in § 2.7.3</span> <li><a href="#valdef-content-list-image">&lt;image></a><span>, in § 2.2</span> <li><a href="#valdef-bookmark-level-integer-1">&lt;integer [1,∞]></a><span>, in § 3.1</span> <li><a href="#valdef-string-last">last</a><span>, in § 2.7.2</span> <li> leader() <ul> <li><a href="#funcdef-leader">(function)</a><span>, in § 2.5.1</span> <li><a href="#funcdef-content-leader">function for content, &lt;content-list></a><span>, in § 2.5.1</span> </ul> <li><a href="#typedef-leader-type">&lt;leader-type></a><span>, in § 2.5.1</span> <li><a href="#valdef-content-marker">marker</a><span>, in § 2.7.3</span> <li><a href="#valdef-quotes-match-parent">match-parent</a><span>, in § 2.4.1</span> <li><a href="#named-string">named string</a><span>, in § 2.7</span> <li><a href="#valdef-content-no-close-quote">no-close-quote</a><span>, in § 2.4.2</span> <li> none <ul> <li><a href="#valdef-bookmark-level-none">value for bookmark-level</a><span>, in § 3.1</span> <li><a href="#valdef-content-none">value for content</a><span>, in § 1</span> <li><a href="#valdef-quotes-none">value for quotes</a><span>, in § 2.4.1</span> <li><a href="#valdef-string-set-none">value for string-set</a><span>, in § 2.7.1</span> </ul> <li><a href="#valdef-content-no-open-quote">no-open-quote</a><span>, in § 2.4.2</span> <li><a href="#valdef-content-normal">normal</a><span>, in § 1</span> <li><a href="#valdef-bookmark-state-open">open</a><span>, in § 3.3</span> <li><a href="#valdef-content-open-quote">open-quote</a><span>, in § 2.4.2</span> <li><a href="#quotation-mark-system">quotation mark system</a><span>, in § 2.4.1</span> <li><a href="#typedef-quote">&lt;quote></a><span>, in § 2.4.2</span> <li><a href="#quote-depth">quote depth</a><span>, in § 2.4.2</span> <li><a href="#propdef-quotes">quotes</a><span>, in § 2.4.1</span> <li><a href="#valdef-leader-solid">solid</a><span>, in § 2.5.1</span> <li><a href="#valdef-leader-space">space</a><span>, in § 2.5.1</span> <li><a href="#valdef-string-start">start</a><span>, in § 2.7.2</span> <li> &lt;string> <ul> <li><a href="#valdef-content-string">value for content, &lt;content-list></a><span>, in § 2.1</span> <li><a href="#valdef-leader-string">value for leader()</a><span>, in § 2.5.1</span> </ul> <li><a href="#funcdef-string">string()</a><span>, in § 2.7.2</span> <li><a href="#valdef-content---string--counter--attr">/ [ &lt;string> | &lt;counter> | &lt;attr()> ]+</a><span>, in § 1</span> <li><a href="#propdef-string-set">string-set</a><span>, in § 2.7.1</span> <li><a href="#typedef-target">&lt;target></a><span>, in § 2.6</span> <li><a href="#funcdef-target-counter">target-counter()</a><span>, in § 2.6.1</span> <li><a href="#funcdef-target-counters">target-counters()</a><span>, in § 2.6.2</span> <li><a href="#target-text-function">target-text()</a><span>, in § 2.6.3</span> <li><a href="#valdef-content-text">text</a><span>, in § 2.7.3</span> </ul> <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3> <ul class="index"> <li> <a data-link-type="biblio">[CSS-CASCADE-5]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="9cd25054">computed value</span> </ul> <li> <a data-link-type="biblio">[CSS-CONTAIN-2]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="9b54ada7">style containment</span> </ul> <li> <a data-link-type="biblio">[CSS-COUNTER-STYLES-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="ab039d4e">&lt;counter-style></span> </ul> <li> <a data-link-type="biblio">[CSS-DISPLAY-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="e7f0dd6c">display</span> </ul> <li> <a data-link-type="biblio">[CSS-IMAGES-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="998b9e6e">&lt;image></span> <li><span class="dfn-paneled" id="d3936525">natural dimension</span> </ul> <li> <a data-link-type="biblio">[CSS-IMAGES-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="e1b8b09d">invalid image</span> </ul> <li> <a data-link-type="biblio">[CSS-LISTS-3]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="64fba2c3">&lt;counter></span> </ul> <li> <a data-link-type="biblio">[CSS-PSEUDO-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="fd0c9e35">::after</span> <li><span class="dfn-paneled" id="5869f885">::before</span> <li><span class="dfn-paneled" id="2bba1ba1">::file-selector-button</span> <li><span class="dfn-paneled" id="a1addf6c">::first-letter</span> <li><span class="dfn-paneled" id="5875aeb9">::marker</span> <li><span class="dfn-paneled" id="7a805ba1">::placeholder</span> </ul> <li> <a data-link-type="biblio">[CSS-TEXT-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="5879b11d">content language</span> <li><span class="dfn-paneled" id="09e0ad83">white space</span> </ul> <li> <a data-link-type="biblio">[CSS-VALUES-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="68487d22">#</span> <li><span class="dfn-paneled" id="bedd9d42">+</span> <li><span class="dfn-paneled" id="9f9120ff">,</span> <li><span class="dfn-paneled" id="e274345c">&lt;custom-ident></span> <li><span class="dfn-paneled" id="70c9f859">&lt;integer></span> <li><span class="dfn-paneled" id="977d3003">&lt;string></span> <li><span class="dfn-paneled" id="fa293cdd">&lt;url></span> <li><span class="dfn-paneled" id="537cf076">?</span> <li><span class="dfn-paneled" id="358fd6ff">CSS-wide keywords</span> <li><span class="dfn-paneled" id="6ec67710">|</span> </ul> <li> <a data-link-type="biblio">[CSS-VALUES-5]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="57699934">attr()</span> </ul> <li> <a data-link-type="biblio">[CSS2]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="2161cf2b">pseudo-elements</span> </ul> <li> <a data-link-type="biblio">[CSS3-NAMESPACE]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="ee301461">CSS qualified name</span> </ul> <li> <a data-link-type="biblio">[HTML]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="f0811ff8">img</span> <li><span class="dfn-paneled" id="9dc3e09f">q</span> </ul> <li> <a data-link-type="biblio">[SELECTORS-4]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="efe16f32">:target</span> <li><span class="dfn-paneled" id="82805a4e">originating element</span> </ul> </ul> <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2> <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3> <dl> <dt id="biblio-css-cascade-5">[CSS-CASCADE-5] <dd>Elika Etemad; Miriam Suzanne; Tab Atkins Jr.. <a href="https://drafts.csswg.org/css-cascade-5/"><cite>CSS Cascading and Inheritance Level 5</cite></a>. URL: <a href="https://drafts.csswg.org/css-cascade-5/">https://drafts.csswg.org/css-cascade-5/</a> <dt id="biblio-css-contain-2">[CSS-CONTAIN-2] <dd>Tab Atkins Jr.; Florian Rivoal; Vladimir Levin. <a href="https://drafts.csswg.org/css-contain-2/"><cite>CSS Containment Module Level 2</cite></a>. URL: <a href="https://drafts.csswg.org/css-contain-2/">https://drafts.csswg.org/css-contain-2/</a> <dt id="biblio-css-counter-styles-3">[CSS-COUNTER-STYLES-3] <dd>Tab Atkins Jr.. <a href="https://drafts.csswg.org/css-counter-styles/"><cite>CSS Counter Styles Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-counter-styles/">https://drafts.csswg.org/css-counter-styles/</a> <dt id="biblio-css-display-4">[CSS-DISPLAY-4] <dd><a href="https://drafts.csswg.org/css-display-4/"><cite>CSS Display Module Level 4</cite></a>. Editor's Draft. URL: <a href="https://drafts.csswg.org/css-display-4/">https://drafts.csswg.org/css-display-4/</a> <dt id="biblio-css-images-3">[CSS-IMAGES-3] <dd>Tab Atkins Jr.; Elika Etemad; Lea Verou. <a href="https://drafts.csswg.org/css-images-3/"><cite>CSS Images Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-images-3/">https://drafts.csswg.org/css-images-3/</a> <dt id="biblio-css-images-4">[CSS-IMAGES-4] <dd>Tab Atkins Jr.; Elika Etemad; Lea Verou. <a href="https://drafts.csswg.org/css-images-4/"><cite>CSS Images Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-images-4/">https://drafts.csswg.org/css-images-4/</a> <dt id="biblio-css-lists-3">[CSS-LISTS-3] <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://drafts.csswg.org/css-lists-3/"><cite>CSS Lists and Counters Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-lists-3/">https://drafts.csswg.org/css-lists-3/</a> <dt id="biblio-css-pseudo-4">[CSS-PSEUDO-4] <dd>Daniel Glazman; Elika Etemad; Alan Stearns. <a href="https://drafts.csswg.org/css-pseudo-4/"><cite>CSS Pseudo-Elements Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-pseudo-4/">https://drafts.csswg.org/css-pseudo-4/</a> <dt id="biblio-css-text-4">[CSS-TEXT-4] <dd>Elika Etemad; et al. <a href="https://drafts.csswg.org/css-text-4/"><cite>CSS Text Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-text-4/">https://drafts.csswg.org/css-text-4/</a> <dt id="biblio-css-values-3">[CSS-VALUES-3] <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://drafts.csswg.org/css-values-3/"><cite>CSS Values and Units Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-values-3/">https://drafts.csswg.org/css-values-3/</a> <dt id="biblio-css-values-4">[CSS-VALUES-4] <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://drafts.csswg.org/css-values-4/"><cite>CSS Values and Units Module Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/css-values-4/">https://drafts.csswg.org/css-values-4/</a> <dt id="biblio-css-values-5">[CSS-VALUES-5] <dd>Tab Atkins Jr.; Elika Etemad; Miriam Suzanne. <a href="https://drafts.csswg.org/css-values-5/"><cite>CSS Values and Units Module Level 5</cite></a>. URL: <a href="https://drafts.csswg.org/css-values-5/">https://drafts.csswg.org/css-values-5/</a> <dt id="biblio-css2">[CSS2] <dd>Bert Bos; et al. <a href="https://drafts.csswg.org/css2/"><cite>Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</cite></a>. URL: <a href="https://drafts.csswg.org/css2/">https://drafts.csswg.org/css2/</a> <dt id="biblio-css3-namespace">[CSS3-NAMESPACE] <dd>Elika Etemad. <a href="https://drafts.csswg.org/css-namespaces/"><cite>CSS Namespaces Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-namespaces/">https://drafts.csswg.org/css-namespaces/</a> <dt id="biblio-css3-speech">[CSS3-SPEECH] <dd>Léonie Watson; Elika Etemad. <a href="https://drafts.csswg.org/css-speech-1/"><cite>CSS Speech Module Level 1</cite></a>. URL: <a href="https://drafts.csswg.org/css-speech-1/">https://drafts.csswg.org/css-speech-1/</a> <dt id="biblio-html">[HTML] <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/"><cite>HTML Standard</cite></a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a> <dt id="biblio-rfc2119">[RFC2119] <dd>S. Bradner. <a href="https://datatracker.ietf.org/doc/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a>. March 1997. Best Current Practice. URL: <a href="https://datatracker.ietf.org/doc/html/rfc2119">https://datatracker.ietf.org/doc/html/rfc2119</a> <dt id="biblio-selectors-4">[SELECTORS-4] <dd>Elika Etemad; Tab Atkins Jr.. <a href="https://drafts.csswg.org/selectors/"><cite>Selectors Level 4</cite></a>. URL: <a href="https://drafts.csswg.org/selectors/">https://drafts.csswg.org/selectors/</a> </dl> <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3> <dl> <dt id="biblio-cldr">[CLDR] <dd><a href="https://cldr.unicode.org/"><cite>Unicode Common Locale Data Repository</cite></a>. URL: <a href="https://cldr.unicode.org/">https://cldr.unicode.org/</a> <dt id="biblio-css-text-3">[CSS-TEXT-3] <dd>Elika Etemad; Koji Ishii; Florian Rivoal. <a href="https://drafts.csswg.org/css-text-3/"><cite>CSS Text Module Level 3</cite></a>. URL: <a href="https://drafts.csswg.org/css-text-3/">https://drafts.csswg.org/css-text-3/</a> <dt id="biblio-dom">[DOM] <dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/"><cite>DOM Standard</cite></a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a> </dl> <h2 class="no-num no-ref heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2> <div class="big-element-wrapper"> <table class="index"> <thead> <tr> <th scope="col">Name <th scope="col">Value <th scope="col">Initial <th scope="col">Applies to <th scope="col">Inh. <th scope="col">%ages <th scope="col">Anim­ation type <th scope="col">Canonical order <th scope="col">Com­puted value <tbody> <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-bookmark-label" id="ref-for-propdef-bookmark-label④">bookmark-label</a> <td>&lt;content-list> <td>content(text) <td>all elements <td>no <td>N/A <td>discrete <td>per grammar <td>specified value <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-bookmark-level" id="ref-for-propdef-bookmark-level⑤">bookmark-level</a> <td>none | &lt;integer [1,∞]> <td>none <td>all elements <td>no <td>N/A <td>by computed value type <td>per grammar <td>the keyword none or the specified integer <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-bookmark-state" id="ref-for-propdef-bookmark-state⑤">bookmark-state</a> <td>open | closed <td>open <td>block-level elements <td>no <td>N/A <td>discrete <td>per grammar <td>specified keyword <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-content" id="ref-for-propdef-content①⑧">content</a> <td>normal | none | [ &lt;content-replacement> | &lt;content-list> ] [/ [ &lt;string> | &lt;counter> | &lt;attr()> ]+ ]? <td>normal <td>all elements, tree-abiding pseudo-elements, and page margin boxes <td>no <td>n/a <td>discrete <td>per grammar <td>See prose below <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-quotes" id="ref-for-propdef-quotes⑤">quotes</a> <td>auto | none | match-parent | [ &lt;string> &lt;string> ]+ <td>auto <td>all elements <td>yes <td>n/a <td>discrete <td>per grammar <td>the keyword none, the keyword auto or match-parent, or a list, each item a pair of string values <tr> <th scope="row"><a class="css" data-link-type="property" href="#propdef-string-set" id="ref-for-propdef-string-set⑥">string-set</a> <td>none | [ &lt;custom-ident> &lt;string>+ ]# <td>none <td>all elements, but not pseudo-elements <td>no <td>N/A <td>discrete <td>per grammar <td>the keyword none or a list, each item an identifier paired with a list of string values </table> </div> <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span><a class="self-link" href="#issues-index"></a></h2> <div style="counter-reset:issue"> <div class="issue"> The above <a data-link-type="dfn" href="https://drafts.csswg.org/css-images-4/#invalid-image">invalid image</a> behavior appears to be what Chrome is doing. Is this okay? Is there a better behavior we can/should use? <a class="issue-return" href="#issue-b8fd18a9" title="Jump to section">↵</a></div> <div class="issue"> This value has historically been treated as <a class="production css" data-link-type="type" href="#typedef-content-content-list">&lt;content-list></a> on <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-before">::before</a> and <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-pseudo-4/#selectordef-after">::after</a>. Presumably there’s a Web-compat requirement on this, so these pseudo-elements might need an exception. <a href="https://github.com/w3c/csswg-drafts/issues/2889">[Issue #2889]</a> <a class="issue-return" href="#issue-7afc79f1" title="Jump to section">↵</a></div> <div class="issue"> Should the contents keyword be replaced with <a class="css" data-link-type="maybe" href="#funcdef-content">content()</a>? <a class="issue-return" href="#issue-a8fbc981" title="Jump to section">↵</a></div> <div class="issue"> Start work on an AAM for CSS. <a class="issue-return" href="#issue-9c60e2c1" title="Jump to section">↵</a></div> <div class="issue"> CSS2.1 explicitly allowed the UA to substitute a broken image icon if the image was invalid. However, no browser appears to do this. Is this removal okay? <a class="issue-return" href="#issue-3ef3081c" title="Jump to section">↵</a></div> <div class="issue"> Should this behave as an empty string on pseudo-elements? <a class="issue-return" href="#issue-bf2f178e" title="Jump to section">↵</a></div> <div class="issue"> Use cases for suppressing the content on the element and using it in a pseudo-element would be welcome. <a class="issue-return" href="#issue-bfc60bbc" title="Jump to section">↵</a></div> <div class="issue"> Do we need the statement about marker pseudo-elements here? Or is this legacy from the old version of the spec? <a class="issue-return" href="#issue-9fa9cc25" title="Jump to section">↵</a></div> <div class="issue"> Two possible approaches here, currently speccing the latter: a) this computes to the relevant string values, and inherits as such. b) this value effectively inherits as a keyword + a language code, meaning <a class="css" data-link-type="maybe" href="#valdef-quotes-auto">auto</a>, but with this language. <a class="issue-return" href="#issue-962b52bc" title="Jump to section">↵</a></div> <div class="issue"> Do leaders depend on the assumption that the content after the leader is right-aligned (end-aligned)? <a class="issue-return" href="#issue-2f5c8d3f" title="Jump to section">↵</a></div> <div class="issue"> what to do if <var>after content</var> is wider than the line box? <a class="issue-return" href="#issue-449754e4" title="Jump to section">↵</a></div> <div class="issue"> Leaders don’t quite work in table layouts. How can we fix this? <a class="issue-return" href="#issue-bb18b3e4" title="Jump to section">↵</a></div> <div class="issue"> what should error handling be? <a class="issue-return" href="#issue-7443dd19" title="Jump to section">↵</a></div> <div class="issue"> restrict syntactically to local references for now. <a class="issue-return" href="#issue-2b2bd98b" title="Jump to section">↵</a></div> <div class="issue"> found a compelling example, in CSS specs. Do something. <a class="issue-return" href="#issue-6e7203db" title="Jump to section">↵</a></div> <div class="issue"> A simpler syntax has been proposed by fantasai: <a href="http://lists.w3.org/Archives/Public/www-style/2012Feb/0745.html">http://lists.w3.org/Archives/Public/www-style/2012Feb/0745.html</a> <a class="issue-return" href="#issue-a82075c9" title="Jump to section">↵</a></div> <div class="issue"> we may need to kill the entire content string. Is this necessary? <a class="issue-return" href="#issue-c24bc3d7" title="Jump to section">↵</a></div> <div class="issue"> Should this move back to CSS Content? <a class="issue-return" href="#issue-0161c10e" title="Jump to section">↵</a></div> <div class="issue"> Should a bookmark be created for elements with <code class="highlight"><c- k>display</c-><c- p>:</c-> none</code>? <a class="issue-return" href="#issue-de0f5f60" title="Jump to section">↵</a></div> <div class="issue"> Is the initial bookmark state, or the bookmark state updated by the UA as appropriate? <a class="issue-return" href="#issue-be5a86f5" title="Jump to section">↵</a></div> </div> <details class="mdn-anno unpositioned" data-anno-for="content-property"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/content" title="The content CSS property replaces an element with a generated value. Objects inserted using the content property are anonymous replaced elements.">content</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>1+</span></span><span class="safari yes"><span>Safari</span><span>1+</span></span><span class="chrome yes"><span>Chrome</span><span>1+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>4+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>8+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android yes"><span>Opera Mobile</span><span>10.1+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="quotes"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/quotes" title="The quotes CSS property sets how the browser should render quotation marks that are added using the open-quotes or close-quotes values of the CSS content property.">quotes</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>1.5+</span></span><span class="safari yes"><span>Safari</span><span>9+</span></span><span class="chrome yes"><span>Chrome</span><span>11+</span></span> <hr> <span class="opera yes"><span>Opera</span><span>4+</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>8+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>37+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> </div> </div> </details> <script>/* Boilerplate: script-dom-helper */ "use strict"; function query(sel) { return document.querySelector(sel); } function queryAll(sel) { return [...document.querySelectorAll(sel)]; } function iter(obj) { if(!obj) return []; var it = obj[Symbol.iterator]; if(it) return it; return Object.entries(obj); } function mk(tagname, attrs, ...children) { const el = document.createElement(tagname); for(const [k,v] of iter(attrs)) { if(k.slice(0,3) == "_on") { const eventName = k.slice(3); el.addEventListener(eventName, v); } else if(k[0] == "_") { // property, not attribute el[k.slice(1)] = v; } else { if(v === false || v == null) { continue; } else if(v === true) { el.setAttribute(k, ""); continue; } else { el.setAttribute(k, v); } } } append(el, children); return el; } /* Create shortcuts for every known HTML element */ [ "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "meta", "meter", "nav", "nobr", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "pre", "progress", "q", "s", "samp", "script", "section", "select", "small", "source", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "u", "ul", "var", "video", "wbr", "xmp", ].forEach(tagname=>{ mk[tagname] = (...args) => mk(tagname, ...args); }); function* nodesFromChildList(children) { for(const child of children.flat(Infinity)) { if(child instanceof Node) { yield child; } else { yield new Text(child); } } } function append(el, ...children) { for(const child of nodesFromChildList(children)) { if(el instanceof Node) el.appendChild(child); else el.push(child); } return el; } function insertAfter(el, ...children) { for(const child of nodesFromChildList(children)) { el.parentNode.insertBefore(child, el.nextSibling); } return el; } function clearContents(el) { el.innerHTML = ""; return el; } function parseHTML(markup) { if(markup.toLowerCase().trim().indexOf('<!doctype') === 0) { const doc = document.implementation.createHTMLDocument(""); doc.documentElement.innerHTML = markup; return doc; } else { const el = mk.template({}); el.innerHTML = markup; return el.content; } }</script> <script>/* Boilerplate: script-dfn-panel */ "use strict"; { let dfnPanelData = { "09e0ad83": {"dfnID":"09e0ad83","dfnText":"white space","external":true,"refSections":[{"refs":[{"id":"ref-for-white-space"},{"id":"ref-for-white-space\u2460"}],"title":"2.1. \nBasic Strings: <string> and <attr()> values"}],"url":"https://drafts.csswg.org/css-text-4/#white-space"}, "2161cf2b": {"dfnID":"2161cf2b","dfnText":"pseudo-elements","external":true,"refSections":[{"refs":[{"id":"ref-for-x22"}],"title":"1. \nInserting and Replacing Content: the content property"}],"url":"https://www.w3.org/TR/CSS21/selector.html#x22"}, "2bba1ba1": {"dfnID":"2bba1ba1","dfnText":"::file-selector-button","external":true,"refSections":[{"refs":[{"id":"ref-for-selectordef-file-selector-button"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-selectordef-file-selector-button\u2460"}],"title":"4. Changes"}],"url":"https://drafts.csswg.org/css-pseudo-4/#selectordef-file-selector-button"}, "358fd6ff": {"dfnID":"358fd6ff","dfnText":"CSS-wide keywords","external":true,"refSections":[{"refs":[{"id":"ref-for-css-wide-keywords"}],"title":"\nValue Definitions"}],"url":"https://drafts.csswg.org/css-values-4/#css-wide-keywords"}, "537cf076": {"dfnID":"537cf076","dfnText":"?","external":true,"refSections":[{"refs":[{"id":"ref-for-mult-opt"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-mult-opt\u2460"}],"title":"2.6.1. \nThe target-counter() function"},{"refs":[{"id":"ref-for-mult-opt\u2461"}],"title":"2.6.2. \nThe target-counters() function\n"},{"refs":[{"id":"ref-for-mult-opt\u2462"}],"title":"2.6.3. \nThe target-text() function"},{"refs":[{"id":"ref-for-mult-opt\u2463"}],"title":"2.7.2. \nInserting Named Strings: the string() function"},{"refs":[{"id":"ref-for-mult-opt\u2464"}],"title":"2.7.3. \nThe content() function"}],"url":"https://drafts.csswg.org/css-values-4/#mult-opt"}, "57699934": {"dfnID":"57699934","dfnText":"attr()","external":true,"refSections":[{"refs":[{"id":"ref-for-funcdef-attr"},{"id":"ref-for-funcdef-attr\u2460"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-funcdef-attr\u2461"}],"title":"2. \nGenerated Content Values: the <content-list> type"},{"refs":[{"id":"ref-for-funcdef-attr\u2462"},{"id":"ref-for-funcdef-attr\u2463"}],"title":"2.1. \nBasic Strings: <string> and <attr()> values"}],"url":"https://drafts.csswg.org/css-values-5/#funcdef-attr"}, "5869f885": {"dfnID":"5869f885","dfnText":"::before","external":true,"refSections":[{"refs":[{"id":"ref-for-selectordef-before"},{"id":"ref-for-selectordef-before\u2460"},{"id":"ref-for-selectordef-before\u2461"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-selectordef-before\u2462"}],"title":"2.7.3. \nThe content() function"}],"url":"https://drafts.csswg.org/css-pseudo-4/#selectordef-before"}, "5875aeb9": {"dfnID":"5875aeb9","dfnText":"::marker","external":true,"refSections":[{"refs":[{"id":"ref-for-selectordef-marker"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-selectordef-marker\u2460"}],"title":"2.3. \nElemental Content: the contents keyword"},{"refs":[{"id":"ref-for-selectordef-marker\u2461"}],"title":"2.7.3. \nThe content() function"}],"url":"https://drafts.csswg.org/css-pseudo-4/#selectordef-marker"}, "5879b11d": {"dfnID":"5879b11d","dfnText":"content language","external":true,"refSections":[{"refs":[{"id":"ref-for-content-language"},{"id":"ref-for-content-language\u2460"}],"title":"2.4.1. \nQuotation Mark System: the quotes property"},{"refs":[{"id":"ref-for-content-language\u2461"},{"id":"ref-for-content-language\u2462"}],"title":"4. Changes"}],"url":"https://drafts.csswg.org/css-text-4/#content-language"}, "64fba2c3": {"dfnID":"64fba2c3","dfnText":"<counter>","external":true,"refSections":[{"refs":[{"id":"ref-for-typedef-counter"},{"id":"ref-for-typedef-counter\u2460"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-typedef-counter\u2461"}],"title":"2. \nGenerated Content Values: the <content-list> type"}],"url":"https://drafts.csswg.org/css-lists-3/#typedef-counter"}, "68487d22": {"dfnID":"68487d22","dfnText":"#","external":true,"refSections":[{"refs":[{"id":"ref-for-mult-comma"}],"title":"2.7.1. \nNaming Strings: the string-set property"}],"url":"https://drafts.csswg.org/css-values-4/#mult-comma"}, "6ec67710": {"dfnID":"6ec67710","dfnText":"|","external":true,"refSections":[{"refs":[{"id":"ref-for-comb-one"},{"id":"ref-for-comb-one\u2460"},{"id":"ref-for-comb-one\u2461"},{"id":"ref-for-comb-one\u2462"},{"id":"ref-for-comb-one\u2463"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-comb-one\u2464"},{"id":"ref-for-comb-one\u2465"},{"id":"ref-for-comb-one\u2466"},{"id":"ref-for-comb-one\u2467"},{"id":"ref-for-comb-one\u2468"},{"id":"ref-for-comb-one\u2460\u24ea"},{"id":"ref-for-comb-one\u2460\u2460"},{"id":"ref-for-comb-one\u2460\u2461"},{"id":"ref-for-comb-one\u2460\u2462"}],"title":"2. \nGenerated Content Values: the <content-list> type"},{"refs":[{"id":"ref-for-comb-one\u2460\u2463"},{"id":"ref-for-comb-one\u2460\u2464"},{"id":"ref-for-comb-one\u2460\u2465"}],"title":"2.4.1. \nQuotation Mark System: the quotes property"},{"refs":[{"id":"ref-for-comb-one\u2460\u2466"},{"id":"ref-for-comb-one\u2460\u2467"},{"id":"ref-for-comb-one\u2460\u2468"}],"title":"2.4.2. \nInserting Quotation Marks: the *-quote keywords"},{"refs":[{"id":"ref-for-comb-one\u2461\u24ea"},{"id":"ref-for-comb-one\u2461\u2460"},{"id":"ref-for-comb-one\u2461\u2461"}],"title":"2.5.1. \nThe leader() function"},{"refs":[{"id":"ref-for-comb-one\u2461\u2462"},{"id":"ref-for-comb-one\u2461\u2463"}],"title":"2.6. \nCross References"},{"refs":[{"id":"ref-for-comb-one\u2461\u2464"}],"title":"2.6.1. \nThe target-counter() function"},{"refs":[{"id":"ref-for-comb-one\u2461\u2465"}],"title":"2.6.2. \nThe target-counters() function\n"},{"refs":[{"id":"ref-for-comb-one\u2461\u2466"},{"id":"ref-for-comb-one\u2461\u2467"},{"id":"ref-for-comb-one\u2461\u2468"},{"id":"ref-for-comb-one\u2462\u24ea"}],"title":"2.6.3. \nThe target-text() function"},{"refs":[{"id":"ref-for-comb-one\u2462\u2460"}],"title":"2.7.1. \nNaming Strings: the string-set property"},{"refs":[{"id":"ref-for-comb-one\u2462\u2461"},{"id":"ref-for-comb-one\u2462\u2462"},{"id":"ref-for-comb-one\u2462\u2463"}],"title":"2.7.2. \nInserting Named Strings: the string() function"},{"refs":[{"id":"ref-for-comb-one\u2462\u2464"},{"id":"ref-for-comb-one\u2462\u2465"},{"id":"ref-for-comb-one\u2462\u2466"},{"id":"ref-for-comb-one\u2462\u2467"}],"title":"2.7.3. \nThe content() function"},{"refs":[{"id":"ref-for-comb-one\u2462\u2468"}],"title":"3.1. \nSetting a Bookmark: the bookmark-level property\n"},{"refs":[{"id":"ref-for-comb-one\u2463\u24ea"}],"title":"3.3. \nInitial Bookmark Toggle State: the bookmark-state property"}],"url":"https://drafts.csswg.org/css-values-4/#comb-one"}, "70c9f859": {"dfnID":"70c9f859","dfnText":"<integer>","external":true,"refSections":[{"refs":[{"id":"ref-for-integer-value"},{"id":"ref-for-integer-value\u2460"}],"title":"3.1. \nSetting a Bookmark: the bookmark-level property\n"}],"url":"https://drafts.csswg.org/css-values-4/#integer-value"}, "7a805ba1": {"dfnID":"7a805ba1","dfnText":"::placeholder","external":true,"refSections":[{"refs":[{"id":"ref-for-selectordef-placeholder"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-selectordef-placeholder\u2460"}],"title":"4. Changes"}],"url":"https://drafts.csswg.org/css-pseudo-4/#selectordef-placeholder"}, "82805a4e": {"dfnID":"82805a4e","dfnText":"originating element","external":true,"refSections":[{"refs":[{"id":"ref-for-originating-element"}],"title":"1. \nInserting and Replacing Content: the content property"}],"url":"https://drafts.csswg.org/selectors-4/#originating-element"}, "977d3003": {"dfnID":"977d3003","dfnText":"<string>","external":true,"refSections":[{"refs":[{"id":"ref-for-string-value"},{"id":"ref-for-string-value\u2460"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-string-value\u2461"}],"title":"2. \nGenerated Content Values: the <content-list> type"},{"refs":[{"id":"ref-for-string-value\u2462"},{"id":"ref-for-string-value\u2463"}],"title":"2.1. \nBasic Strings: <string> and <attr()> values"},{"refs":[{"id":"ref-for-string-value\u2464"},{"id":"ref-for-string-value\u2465"},{"id":"ref-for-string-value\u2466"},{"id":"ref-for-string-value\u2467"},{"id":"ref-for-string-value\u2468"}],"title":"2.4.1. \nQuotation Mark System: the quotes property"},{"refs":[{"id":"ref-for-string-value\u2460\u24ea"},{"id":"ref-for-string-value\u2460\u2460"}],"title":"2.5.1. \nThe leader() function"},{"refs":[{"id":"ref-for-string-value\u2460\u2461"}],"title":"2.6.1. \nThe target-counter() function"},{"refs":[{"id":"ref-for-string-value\u2460\u2462"},{"id":"ref-for-string-value\u2460\u2463"}],"title":"2.6.2. \nThe target-counters() function\n"},{"refs":[{"id":"ref-for-string-value\u2460\u2464"}],"title":"2.6.3. \nThe target-text() function"},{"refs":[{"id":"ref-for-string-value\u2460\u2465"},{"id":"ref-for-string-value\u2460\u2466"},{"id":"ref-for-string-value\u2460\u2467"}],"title":"2.7.1. \nNaming Strings: the string-set property"}],"url":"https://drafts.csswg.org/css-values-4/#string-value"}, "998b9e6e": {"dfnID":"998b9e6e","dfnText":"<image>","external":true,"refSections":[{"refs":[{"id":"ref-for-typedef-image"},{"id":"ref-for-typedef-image\u2460"},{"id":"ref-for-typedef-image\u2461"},{"id":"ref-for-typedef-image\u2462"},{"id":"ref-for-typedef-image\u2463"},{"id":"ref-for-typedef-image\u2464"},{"id":"ref-for-typedef-image\u2465"},{"id":"ref-for-typedef-image\u2466"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-typedef-image\u2467"}],"title":"2. \nGenerated Content Values: the <content-list> type"},{"refs":[{"id":"ref-for-typedef-image\u2468"},{"id":"ref-for-typedef-image\u2460\u24ea"},{"id":"ref-for-typedef-image\u2460\u2460"},{"id":"ref-for-typedef-image\u2460\u2461"}],"title":"2.2. \n2D Images: <image> values"}],"url":"https://drafts.csswg.org/css-images-3/#typedef-image"}, "9b54ada7": {"dfnID":"9b54ada7","dfnText":"style containment","external":true,"refSections":[{"refs":[{"id":"ref-for-style-containment"}],"title":"2.7.1. \nNaming Strings: the string-set property"},{"refs":[{"id":"ref-for-style-containment\u2460"}],"title":"3. \nBookmarks"}],"url":"https://drafts.csswg.org/css-contain-2/#style-containment"}, "9cd25054": {"dfnID":"9cd25054","dfnText":"computed value","external":true,"refSections":[{"refs":[{"id":"ref-for-computed-value"}],"title":"2.4.1. \nQuotation Mark System: the quotes property"}],"url":"https://drafts.csswg.org/css-cascade-5/#computed-value"}, "9dc3e09f": {"dfnID":"9dc3e09f","dfnText":"q","external":true,"refSections":[{"refs":[{"id":"ref-for-the-q-element"}],"title":"2.4. \nQuotation Marks"}],"url":"https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-q-element"}, "9f9120ff": {"dfnID":"9f9120ff","dfnText":",","external":true,"refSections":[{"refs":[{"id":"ref-for-comb-comma"},{"id":"ref-for-comb-comma\u2460"}],"title":"2.6.1. \nThe target-counter() function"},{"refs":[{"id":"ref-for-comb-comma\u2461"},{"id":"ref-for-comb-comma\u2462"},{"id":"ref-for-comb-comma\u2463"}],"title":"2.6.2. \nThe target-counters() function\n"},{"refs":[{"id":"ref-for-comb-comma\u2464"}],"title":"2.6.3. \nThe target-text() function"},{"refs":[{"id":"ref-for-comb-comma\u2465"}],"title":"2.7.2. \nInserting Named Strings: the string() function"}],"url":"https://drafts.csswg.org/css-values-4/#comb-comma"}, "a1addf6c": {"dfnID":"a1addf6c","dfnText":"::first-letter","external":true,"refSections":[{"refs":[{"id":"ref-for-selectordef-first-letter"}],"title":"2.7.3. \nThe content() function"}],"url":"https://drafts.csswg.org/css-pseudo-4/#selectordef-first-letter"}, "ab039d4e": {"dfnID":"ab039d4e","dfnText":"<counter-style>","external":true,"refSections":[{"refs":[{"id":"ref-for-typedef-counter-style"}],"title":"2.6.1. \nThe target-counter() function"},{"refs":[{"id":"ref-for-typedef-counter-style\u2460"}],"title":"2.6.2. \nThe target-counters() function\n"}],"url":"https://drafts.csswg.org/css-counter-styles-3/#typedef-counter-style"}, "bedd9d42": {"dfnID":"bedd9d42","dfnText":"+","external":true,"refSections":[{"refs":[{"id":"ref-for-mult-one-plus"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-mult-one-plus\u2460"}],"title":"2. \nGenerated Content Values: the <content-list> type"},{"refs":[{"id":"ref-for-mult-one-plus\u2461"}],"title":"2.4.1. \nQuotation Mark System: the quotes property"},{"refs":[{"id":"ref-for-mult-one-plus\u2462"}],"title":"2.7.1. \nNaming Strings: the string-set property"}],"url":"https://drafts.csswg.org/css-values-4/#mult-one-plus"}, "bookmarks": {"dfnID":"bookmarks","dfnText":"bookmarks","external":false,"refSections":[],"url":"#bookmarks"}, "d3936525": {"dfnID":"d3936525","dfnText":"natural dimension","external":true,"refSections":[{"refs":[{"id":"ref-for-natural-dimensions"}],"title":"1. \nInserting and Replacing Content: the content property"}],"url":"https://drafts.csswg.org/css-images-3/#natural-dimensions"}, "e1b8b09d": {"dfnID":"e1b8b09d","dfnText":"invalid image","external":true,"refSections":[{"refs":[{"id":"ref-for-invalid-image"},{"id":"ref-for-invalid-image\u2460"},{"id":"ref-for-invalid-image\u2461"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-invalid-image\u2462"}],"title":"2.2. \n2D Images: <image> values"}],"url":"https://drafts.csswg.org/css-images-4/#invalid-image"}, "e274345c": {"dfnID":"e274345c","dfnText":"<custom-ident>","external":true,"refSections":[{"refs":[{"id":"ref-for-identifier-value"}],"title":"2.6.1. \nThe target-counter() function"},{"refs":[{"id":"ref-for-identifier-value\u2460"}],"title":"2.6.2. \nThe target-counters() function\n"},{"refs":[{"id":"ref-for-identifier-value\u2461"},{"id":"ref-for-identifier-value\u2462"},{"id":"ref-for-identifier-value\u2463"}],"title":"2.7.1. \nNaming Strings: the string-set property"},{"refs":[{"id":"ref-for-identifier-value\u2464"}],"title":"2.7.2. \nInserting Named Strings: the string() function"}],"url":"https://drafts.csswg.org/css-values-4/#identifier-value"}, "e7f0dd6c": {"dfnID":"e7f0dd6c","dfnText":"display","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-display"},{"id":"ref-for-propdef-display\u2460"},{"id":"ref-for-propdef-display\u2461"}],"title":"1. \nInserting and Replacing Content: the content property"}],"url":"https://drafts.csswg.org/css-display-4/#propdef-display"}, "ee301461": {"dfnID":"ee301461","dfnText":"CSS qualified name","external":true,"refSections":[{"refs":[{"id":"ref-for-css-qualified-name"}],"title":"2.1. \nBasic Strings: <string> and <attr()> values"}],"url":"https://drafts.csswg.org/css-namespaces-3/#css-qualified-name"}, "efe16f32": {"dfnID":"efe16f32","dfnText":":target","external":true,"refSections":[{"refs":[{"id":"ref-for-target-pseudo"}],"title":"3. \nBookmarks"}],"url":"https://drafts.csswg.org/selectors-4/#target-pseudo"}, "entry-value": {"dfnID":"entry-value","dfnText":"entry value","external":false,"refSections":[{"refs":[{"id":"ref-for-entry-value"},{"id":"ref-for-entry-value\u2460"},{"id":"ref-for-entry-value\u2461"}],"title":"2.7.2. \nInserting Named Strings: the string() function"}],"url":"#entry-value"}, "exit-value": {"dfnID":"exit-value","dfnText":"exit value","external":false,"refSections":[{"refs":[{"id":"ref-for-exit-value"},{"id":"ref-for-exit-value\u2460"}],"title":"2.7.2. \nInserting Named Strings: the string() function"}],"url":"#exit-value"}, "f0811ff8": {"dfnID":"f0811ff8","dfnText":"img","external":true,"refSections":[{"refs":[{"id":"ref-for-the-img-element"}],"title":"1. \nInserting and Replacing Content: the content property"}],"url":"https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element"}, "fa293cdd": {"dfnID":"fa293cdd","dfnText":"<url>","external":true,"refSections":[{"refs":[{"id":"ref-for-url-value"}],"title":"2.6.1. \nThe target-counter() function"},{"refs":[{"id":"ref-for-url-value\u2460"}],"title":"2.6.2. \nThe target-counters() function\n"},{"refs":[{"id":"ref-for-url-value\u2461"}],"title":"2.6.3. \nThe target-text() function"}],"url":"https://drafts.csswg.org/css-values-4/#url-value"}, "fd0c9e35": {"dfnID":"fd0c9e35","dfnText":"::after","external":true,"refSections":[{"refs":[{"id":"ref-for-selectordef-after"},{"id":"ref-for-selectordef-after\u2460"},{"id":"ref-for-selectordef-after\u2461"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-selectordef-after\u2462"}],"title":"2.7.3. \nThe content() function"}],"url":"https://drafts.csswg.org/css-pseudo-4/#selectordef-after"}, "funcdef-content": {"dfnID":"funcdef-content","dfnText":"content()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-content"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-funcdef-content\u2460"}],"title":"2. \nGenerated Content Values: the <content-list> type"},{"refs":[{"id":"ref-for-funcdef-content\u2461"},{"id":"ref-for-funcdef-content\u2462"}],"title":"2.7.3. \nThe content() function"}],"url":"#funcdef-content"}, "funcdef-content-leader": {"dfnID":"funcdef-content-leader","dfnText":"leader( <leader-type> )","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-content-leader"}],"title":"2. \nGenerated Content Values: the <content-list> type"},{"refs":[{"id":"ref-for-funcdef-content-leader\u2460"}],"title":"2.5. \nLeaders"},{"refs":[{"id":"ref-for-funcdef-content-leader\u2461"}],"title":"2.5.1. \nThe leader() function"}],"url":"#funcdef-content-leader"}, "funcdef-leader": {"dfnID":"funcdef-leader","dfnText":"leader()","external":false,"refSections":[],"url":"#funcdef-leader"}, "funcdef-string": {"dfnID":"funcdef-string","dfnText":"string()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-string"}],"title":"2. \nGenerated Content Values: the <content-list> type"},{"refs":[{"id":"ref-for-funcdef-string\u2460"},{"id":"ref-for-funcdef-string\u2461"}],"title":"2.7.1. \nNaming Strings: the string-set property"},{"refs":[{"id":"ref-for-funcdef-string\u2462"},{"id":"ref-for-funcdef-string\u2463"},{"id":"ref-for-funcdef-string\u2464"}],"title":"2.7.2. \nInserting Named Strings: the string() function"}],"url":"#funcdef-string"}, "funcdef-target-counter": {"dfnID":"funcdef-target-counter","dfnText":"target-counter()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-target-counter"},{"id":"ref-for-funcdef-target-counter\u2460"}],"title":"2.6. \nCross References"},{"refs":[{"id":"ref-for-funcdef-target-counter\u2461"},{"id":"ref-for-funcdef-target-counter\u2462"}],"title":"2.6.1. \nThe target-counter() function"}],"url":"#funcdef-target-counter"}, "funcdef-target-counters": {"dfnID":"funcdef-target-counters","dfnText":"target-counters()","external":false,"refSections":[{"refs":[{"id":"ref-for-funcdef-target-counters"},{"id":"ref-for-funcdef-target-counters\u2460"}],"title":"2.6. \nCross References"},{"refs":[{"id":"ref-for-funcdef-target-counters\u2461"}],"title":"2.6.2. \nThe target-counters() function\n"}],"url":"#funcdef-target-counters"}, "named-string": {"dfnID":"named-string","dfnText":"named strings","external":false,"refSections":[{"refs":[{"id":"ref-for-named-string"}],"title":"2.7.2. \nInserting Named Strings: the string() function"}],"url":"#named-string"}, "propdef-bookmark-label": {"dfnID":"propdef-bookmark-label","dfnText":"bookmark-label","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-bookmark-label"},{"id":"ref-for-propdef-bookmark-label\u2460"}],"title":"3. \nBookmarks"},{"refs":[{"id":"ref-for-propdef-bookmark-label\u2461"}],"title":"3.1. \nSetting a Bookmark: the bookmark-level property\n"},{"refs":[{"id":"ref-for-propdef-bookmark-label\u2462"}],"title":"3.2. \nLabelling a Bookmark: the bookmark-label property"}],"url":"#propdef-bookmark-label"}, "propdef-bookmark-level": {"dfnID":"propdef-bookmark-level","dfnText":"bookmark-level","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-bookmark-level"},{"id":"ref-for-propdef-bookmark-level\u2460"}],"title":"3. \nBookmarks"},{"refs":[{"id":"ref-for-propdef-bookmark-level\u2461"},{"id":"ref-for-propdef-bookmark-level\u2462"}],"title":"3.1. \nSetting a Bookmark: the bookmark-level property\n"},{"refs":[{"id":"ref-for-propdef-bookmark-level\u2463"}],"title":"3.3. \nInitial Bookmark Toggle State: the bookmark-state property"}],"url":"#propdef-bookmark-level"}, "propdef-bookmark-state": {"dfnID":"propdef-bookmark-state","dfnText":"bookmark-state","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-bookmark-state"},{"id":"ref-for-propdef-bookmark-state\u2460"}],"title":"3. \nBookmarks"},{"refs":[{"id":"ref-for-propdef-bookmark-state\u2461"}],"title":"3.1. \nSetting a Bookmark: the bookmark-level property\n"},{"refs":[{"id":"ref-for-propdef-bookmark-state\u2462"},{"id":"ref-for-propdef-bookmark-state\u2463"}],"title":"3.3. \nInitial Bookmark Toggle State: the bookmark-state property"}],"url":"#propdef-bookmark-state"}, "propdef-content": {"dfnID":"propdef-content","dfnText":"content","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-content"},{"id":"ref-for-propdef-content\u2460"},{"id":"ref-for-propdef-content\u2461"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-propdef-content\u2462"}],"title":"1.1. \nAccessibility of Generated Content"},{"refs":[{"id":"ref-for-propdef-content\u2463"}],"title":"1.2. \nAlternative Text for Accessibility"},{"refs":[{"id":"ref-for-propdef-content\u2464"}],"title":"2. \nGenerated Content Values: the <content-list> type"},{"refs":[{"id":"ref-for-propdef-content\u2465"}],"title":"2.1. \nBasic Strings: <string> and <attr()> values"},{"refs":[{"id":"ref-for-propdef-content\u2466"},{"id":"ref-for-propdef-content\u2467"},{"id":"ref-for-propdef-content\u2468"}],"title":"2.3. \nElemental Content: the contents keyword"},{"refs":[{"id":"ref-for-propdef-content\u2460\u24ea"}],"title":"2.4. \nQuotation Marks"},{"refs":[{"id":"ref-for-propdef-content\u2460\u2460"},{"id":"ref-for-propdef-content\u2460\u2461"}],"title":"2.4.1. \nQuotation Mark System: the quotes property"},{"refs":[{"id":"ref-for-propdef-content\u2460\u2462"},{"id":"ref-for-propdef-content\u2460\u2463"}],"title":"2.4.2. \nInserting Quotation Marks: the *-quote keywords"},{"refs":[{"id":"ref-for-propdef-content\u2460\u2464"}],"title":"2.7. \nNamed Strings"},{"refs":[{"id":"ref-for-propdef-content\u2460\u2465"}],"title":"2.7.2. \nInserting Named Strings: the string() function"},{"refs":[{"id":"ref-for-propdef-content\u2460\u2466"}],"title":"4. Changes"}],"url":"#propdef-content"}, "propdef-quotes": {"dfnID":"propdef-quotes","dfnText":"quotes","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-quotes"}],"title":"2.4.1. \nQuotation Mark System: the quotes property"},{"refs":[{"id":"ref-for-propdef-quotes\u2460"},{"id":"ref-for-propdef-quotes\u2461"},{"id":"ref-for-propdef-quotes\u2462"}],"title":"2.4.2. \nInserting Quotation Marks: the *-quote keywords"},{"refs":[{"id":"ref-for-propdef-quotes\u2463"}],"title":"4. Changes"}],"url":"#propdef-quotes"}, "propdef-string-set": {"dfnID":"propdef-string-set","dfnText":"string-set","external":false,"refSections":[{"refs":[{"id":"ref-for-propdef-string-set"}],"title":"2.6.3. \nThe target-text() function"},{"refs":[{"id":"ref-for-propdef-string-set\u2460"}],"title":"2.7. \nNamed Strings"},{"refs":[{"id":"ref-for-propdef-string-set\u2461"},{"id":"ref-for-propdef-string-set\u2462"},{"id":"ref-for-propdef-string-set\u2463"}],"title":"2.7.1. \nNaming Strings: the string-set property"},{"refs":[{"id":"ref-for-propdef-string-set\u2464"}],"title":"3.2. \nLabelling a Bookmark: the bookmark-label property"}],"url":"#propdef-string-set"}, "quotation-mark-system": {"dfnID":"quotation-mark-system","dfnText":"quotation mark system","external":false,"refSections":[{"refs":[{"id":"ref-for-quotation-mark-system"}],"title":"2.4. \nQuotation Marks"},{"refs":[{"id":"ref-for-quotation-mark-system\u2460"},{"id":"ref-for-quotation-mark-system\u2461"},{"id":"ref-for-quotation-mark-system\u2462"}],"title":"2.4.1. \nQuotation Mark System: the quotes property"},{"refs":[{"id":"ref-for-quotation-mark-system\u2463"}],"title":"2.4.2. \nInserting Quotation Marks: the *-quote keywords"}],"url":"#quotation-mark-system"}, "quote-depth": {"dfnID":"quote-depth","dfnText":"quote depth","external":false,"refSections":[{"refs":[{"id":"ref-for-quote-depth"},{"id":"ref-for-quote-depth\u2460"},{"id":"ref-for-quote-depth\u2461"}],"title":"2.4.2. \nInserting Quotation Marks: the *-quote keywords"},{"refs":[{"id":"ref-for-quote-depth\u2462"},{"id":"ref-for-quote-depth\u2463"}],"title":"4. Changes"}],"url":"#quote-depth"}, "target-text-function": {"dfnID":"target-text-function","dfnText":"target-text()","external":false,"refSections":[{"refs":[{"id":"ref-for-target-text-function"},{"id":"ref-for-target-text-function\u2460"}],"title":"2.6. \nCross References"},{"refs":[{"id":"ref-for-target-text-function\u2461"},{"id":"ref-for-target-text-function\u2462"}],"title":"2.6.3. \nThe target-text() function"}],"url":"#target-text-function"}, "typedef-content-content-list": {"dfnID":"typedef-content-content-list","dfnText":"<content-list>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-content-content-list"},{"id":"ref-for-typedef-content-content-list\u2460"},{"id":"ref-for-typedef-content-content-list\u2461"},{"id":"ref-for-typedef-content-content-list\u2462"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-typedef-content-content-list\u2463"}],"title":"1.2. \nAlternative Text for Accessibility"},{"refs":[{"id":"ref-for-typedef-content-content-list\u2464"},{"id":"ref-for-typedef-content-content-list\u2465"},{"id":"ref-for-typedef-content-content-list\u2466"},{"id":"ref-for-typedef-content-content-list\u2467"}],"title":"2. \nGenerated Content Values: the <content-list> type"},{"refs":[{"id":"ref-for-typedef-content-content-list\u2468"},{"id":"ref-for-typedef-content-content-list\u2460\u24ea"},{"id":"ref-for-typedef-content-content-list\u2460\u2460"},{"id":"ref-for-typedef-content-content-list\u2460\u2461"}],"title":"3.2. \nLabelling a Bookmark: the bookmark-label property"}],"url":"#typedef-content-content-list"}, "typedef-content-content-replacement": {"dfnID":"typedef-content-content-replacement","dfnText":"<content-replacement>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-content-content-replacement"},{"id":"ref-for-typedef-content-content-replacement\u2460"},{"id":"ref-for-typedef-content-content-replacement\u2461"}],"title":"1. \nInserting and Replacing Content: the content property"}],"url":"#typedef-content-content-replacement"}, "typedef-leader-type": {"dfnID":"typedef-leader-type","dfnText":"<leader-type>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-leader-type"},{"id":"ref-for-typedef-leader-type\u2460"},{"id":"ref-for-typedef-leader-type\u2461"}],"title":"2.5.1. \nThe leader() function"}],"url":"#typedef-leader-type"}, "typedef-quote": {"dfnID":"typedef-quote","dfnText":"<quote>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-quote"}],"title":"2. \nGenerated Content Values: the <content-list> type"},{"refs":[{"id":"ref-for-typedef-quote\u2460"}],"title":"2.4.2. \nInserting Quotation Marks: the *-quote keywords"}],"url":"#typedef-quote"}, "typedef-target": {"dfnID":"typedef-target","dfnText":"<target>","external":false,"refSections":[{"refs":[{"id":"ref-for-typedef-target"}],"title":"2. \nGenerated Content Values: the <content-list> type"},{"refs":[{"id":"ref-for-typedef-target\u2460"}],"title":"2.6. \nCross References"}],"url":"#typedef-target"}, "valdef-bookmark-label-content-list": {"dfnID":"valdef-bookmark-label-content-list","dfnText":"<content-list>","external":false,"refSections":[],"url":"#valdef-bookmark-label-content-list"}, "valdef-bookmark-level-integer-1": {"dfnID":"valdef-bookmark-level-integer-1","dfnText":"<integer [1,\u221e]>","external":false,"refSections":[],"url":"#valdef-bookmark-level-integer-1"}, "valdef-bookmark-level-none": {"dfnID":"valdef-bookmark-level-none","dfnText":"none","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-bookmark-level-none"},{"id":"ref-for-valdef-bookmark-level-none\u2460"}],"title":"3.1. \nSetting a Bookmark: the bookmark-level property\n"}],"url":"#valdef-bookmark-level-none"}, "valdef-bookmark-state-closed": {"dfnID":"valdef-bookmark-state-closed","dfnText":"closed","external":false,"refSections":[],"url":"#valdef-bookmark-state-closed"}, "valdef-bookmark-state-open": {"dfnID":"valdef-bookmark-state-open","dfnText":"open","external":false,"refSections":[],"url":"#valdef-bookmark-state-open"}, "valdef-content---string--counter--attr": {"dfnID":"valdef-content---string--counter--attr","dfnText":"/ [ <string> | <counter> | <attr()> ]+","external":false,"refSections":[],"url":"#valdef-content---string--counter--attr"}, "valdef-content-after": {"dfnID":"valdef-content-after","dfnText":"after","external":false,"refSections":[],"url":"#valdef-content-after"}, "valdef-content-attr": {"dfnID":"valdef-content-attr","dfnText":"attr()","external":false,"refSections":[],"url":"#valdef-content-attr"}, "valdef-content-before": {"dfnID":"valdef-content-before","dfnText":"before","external":false,"refSections":[],"url":"#valdef-content-before"}, "valdef-content-close-quote": {"dfnID":"valdef-content-close-quote","dfnText":"close-quote","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-content-close-quote"}],"title":"2.4.1. \nQuotation Mark System: the quotes property"}],"url":"#valdef-content-close-quote"}, "valdef-content-contents": {"dfnID":"valdef-content-contents","dfnText":"contents","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-content-contents"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-valdef-content-contents\u2460"},{"id":"ref-for-valdef-content-contents\u2461"},{"id":"ref-for-valdef-content-contents\u2462"},{"id":"ref-for-valdef-content-contents\u2463"}],"title":"2.3. \nElemental Content: the contents keyword"}],"url":"#valdef-content-contents"}, "valdef-content-first-letter": {"dfnID":"valdef-content-first-letter","dfnText":"first-letter","external":false,"refSections":[],"url":"#valdef-content-first-letter"}, "valdef-content-list-image": {"dfnID":"valdef-content-list-image","dfnText":"<image>","external":false,"refSections":[],"url":"#valdef-content-list-image"}, "valdef-content-marker": {"dfnID":"valdef-content-marker","dfnText":"marker","external":false,"refSections":[],"url":"#valdef-content-marker"}, "valdef-content-no-close-quote": {"dfnID":"valdef-content-no-close-quote","dfnText":"no-close-quote","external":false,"refSections":[],"url":"#valdef-content-no-close-quote"}, "valdef-content-no-open-quote": {"dfnID":"valdef-content-no-open-quote","dfnText":"no-open-quote","external":false,"refSections":[],"url":"#valdef-content-no-open-quote"}, "valdef-content-none": {"dfnID":"valdef-content-none","dfnText":"none","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-content-none"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-valdef-content-none\u2460"},{"id":"ref-for-valdef-content-none\u2461"},{"id":"ref-for-valdef-content-none\u2462"}],"title":"2.3. \nElemental Content: the contents keyword"},{"refs":[{"id":"ref-for-valdef-content-none\u2463"}],"title":"2.4.2. \nInserting Quotation Marks: the *-quote keywords"}],"url":"#valdef-content-none"}, "valdef-content-normal": {"dfnID":"valdef-content-normal","dfnText":"normal","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-content-normal"},{"id":"ref-for-valdef-content-normal\u2460"}],"title":"1. \nInserting and Replacing Content: the content property"},{"refs":[{"id":"ref-for-valdef-content-normal\u2461"},{"id":"ref-for-valdef-content-normal\u2462"}],"title":"2.3. \nElemental Content: the contents keyword"}],"url":"#valdef-content-normal"}, "valdef-content-open-quote": {"dfnID":"valdef-content-open-quote","dfnText":"open-quote","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-content-open-quote"}],"title":"2.4.1. \nQuotation Mark System: the quotes property"}],"url":"#valdef-content-open-quote"}, "valdef-content-string": {"dfnID":"valdef-content-string","dfnText":"<string>","external":false,"refSections":[],"url":"#valdef-content-string"}, "valdef-content-text": {"dfnID":"valdef-content-text","dfnText":"text","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-content-text"}],"title":"2.7.3. \nThe content() function"}],"url":"#valdef-content-text"}, "valdef-leader-dotted": {"dfnID":"valdef-leader-dotted","dfnText":"dotted","external":false,"refSections":[],"url":"#valdef-leader-dotted"}, "valdef-leader-solid": {"dfnID":"valdef-leader-solid","dfnText":"solid","external":false,"refSections":[],"url":"#valdef-leader-solid"}, "valdef-leader-space": {"dfnID":"valdef-leader-space","dfnText":"space","external":false,"refSections":[],"url":"#valdef-leader-space"}, "valdef-leader-string": {"dfnID":"valdef-leader-string","dfnText":"<string>","external":false,"refSections":[],"url":"#valdef-leader-string"}, "valdef-quotes-auto": {"dfnID":"valdef-quotes-auto","dfnText":"auto","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-quotes-auto"},{"id":"ref-for-valdef-quotes-auto\u2460"},{"id":"ref-for-valdef-quotes-auto\u2461"}],"title":"2.4.1. \nQuotation Mark System: the quotes property"},{"refs":[{"id":"ref-for-valdef-quotes-auto\u2462"}],"title":"4. Changes"}],"url":"#valdef-quotes-auto"}, "valdef-quotes-match-parent": {"dfnID":"valdef-quotes-match-parent","dfnText":"match-parent","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-quotes-match-parent"}],"title":"2.4.1. \nQuotation Mark System: the quotes property"},{"refs":[{"id":"ref-for-valdef-quotes-match-parent\u2460"}],"title":"4. Changes"}],"url":"#valdef-quotes-match-parent"}, "valdef-quotes-none": {"dfnID":"valdef-quotes-none","dfnText":"none","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-quotes-none"}],"title":"2.4.1. \nQuotation Mark System: the quotes property"}],"url":"#valdef-quotes-none"}, "valdef-string-first": {"dfnID":"valdef-string-first","dfnText":"first","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-string-first"}],"title":"2.7.2. \nInserting Named Strings: the string() function"}],"url":"#valdef-string-first"}, "valdef-string-first-except": {"dfnID":"valdef-string-first-except","dfnText":"first-except","external":false,"refSections":[],"url":"#valdef-string-first-except"}, "valdef-string-last": {"dfnID":"valdef-string-last","dfnText":"last","external":false,"refSections":[],"url":"#valdef-string-last"}, "valdef-string-set-none": {"dfnID":"valdef-string-set-none","dfnText":"none","external":false,"refSections":[{"refs":[{"id":"ref-for-valdef-string-set-none"}],"title":"2.7.1. \nNaming Strings: the string-set property"}],"url":"#valdef-string-set-none"}, "valdef-string-start": {"dfnID":"valdef-string-start","dfnText":"start","external":false,"refSections":[],"url":"#valdef-string-start"}, }; document.addEventListener("DOMContentLoaded", ()=>{ genAllDfnPanels(); document.body.addEventListener("click", (e) => { // If not handled already, just hide all dfn panels. hideAllDfnPanels(); }); }); window.addEventListener("resize", () => { // Pin any visible dfn panel queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(el=>positionDfnPanel(el)); }); function genAllDfnPanels() { for(const panelData of Object.values(dfnPanelData)) { const dfnID = panelData.dfnID; const dfn = document.getElementById(dfnID); if(!dfn) { console.log(`Can't find dfn#${dfnID}.`, panelData); continue; } dfn.panelData = panelData; insertDfnPopupAction(dfn); } } function genDfnPanel(dfn, { dfnID, url, dfnText, refSections, external }) { const dfnPanel = mk.aside({ class: "dfn-panel on", id: `infopanel-for-${dfnID}`, "data-for": dfnID, "aria-labelled-by":`infopaneltitle-for-${dfnID}`, }, mk.span({id:`infopaneltitle-for-${dfnID}`, style:"display:none"}, `Info about the '${dfnText}' ${external?"external":""} reference.`), mk.a({href:url, class:"dfn-link"}, url), refSections.length == 0 ? [] : mk.b({}, "Referenced in:"), mk.ul({}, ...refSections.map(section=> mk.li({}, ...section.refs.map((ref, refI)=> [ mk.a({ href: `#${ref.id}` }, (refI == 0) ? section.title : `(${refI + 1})` ), " ", ] ), ), ), ), genLinkingSyntaxes(dfn), ); dfnPanel.addEventListener('click', (event) => { if (event.target.nodeName == 'A') { scrollToTargetAndHighlight(event); pinDfnPanel(dfnPanel); } event.stopPropagation(); refocusOnTarget(event); }); dfnPanel.addEventListener('keydown', (event) => { if(event.keyCode == 27) { // Escape key hideDfnPanel({dfnPanel}); event.stopPropagation(); event.preventDefault(); } }); dfnPanel.dfn = dfn; dfn.dfnPanel = dfnPanel; return dfnPanel; } function hideAllDfnPanels() { // Delete the currently-active dfn panel. queryAll(".dfn-panel").forEach(dfnPanel=>hideDfnPanel({dfnPanel})); } function showDfnPanel(dfn) { hideAllDfnPanels(); // Only display one at a time. dfn.setAttribute("aria-expanded", "true"); const dfnPanel = genDfnPanel(dfn, dfn.panelData); // Give the dfn a unique tabindex, and then // give all the tabbable panel bits successive indexes. let tabIndex = 100; dfn.tabIndex = tabIndex++; const tabbable = dfnPanel.querySelectorAll(":is(a, button)"); for (const el of tabbable) { el.tabIndex = tabIndex++; } append(document.body, dfnPanel); positionDfnPanel(dfnPanel); } function positionDfnPanel(dfnPanel) { const dfn = dfnPanel.dfn; const dfnPos = getBounds(dfn); dfnPanel.style.top = dfnPos.bottom + "px"; dfnPanel.style.left = dfnPos.left + "px"; const panelPos = dfnPanel.getBoundingClientRect(); const panelMargin = 8; const maxRight = document.body.parentNode.clientWidth - panelMargin; if (panelPos.right > maxRight) { const overflowAmount = panelPos.right - maxRight; const newLeft = Math.max(panelMargin, dfnPos.left - overflowAmount); dfnPanel.style.left = newLeft + "px"; } } function pinDfnPanel(dfnPanel) { // Switch it to "activated" state, which pins it. dfnPanel.classList.add("activated"); dfnPanel.style.position = "fixed"; dfnPanel.style.left = null; dfnPanel.style.top = null; } function hideDfnPanel({dfn, dfnPanel}) { if(!dfnPanel) dfnPanel = dfn.dfnPanel; if(!dfn) dfn = dfnPanel.dfn; dfn.dfnPanel = undefined; dfnPanel.dfn = undefined; dfn.setAttribute("aria-expanded", "false"); dfn.tabIndex = undefined; dfnPanel.remove() } function toggleDfnPanel(dfn) { if(dfn.dfnPanel) { hideDfnPanel(dfn); } else { showDfnPanel(dfn); } } function insertDfnPopupAction(dfn) { dfn.setAttribute('role', 'button'); dfn.setAttribute('aria-expanded', 'false') dfn.tabIndex = 0; dfn.classList.add('has-dfn-panel'); dfn.addEventListener('click', (event) => { toggleDfnPanel(dfn); event.stopPropagation(); }); dfn.addEventListener('keypress', (event) => { const kc = event.keyCode; // 32->Space, 13->Enter if(kc == 32 || kc == 13) { toggleDfnPanel(dfn); event.stopPropagation(); event.preventDefault(); } }); } function refocusOnTarget(event) { const target = event.target; setTimeout(() => { // Refocus on the event.target element. // This is needed after browser scrolls to the destination. target.focus(); }); } // TODO: shared util // Returns the root-level absolute position {left and top} of element. function getBounds(el, relativeTo=document.body) { const relativeRect = relativeTo.getBoundingClientRect(); const elRect = el.getBoundingClientRect(); const top = elRect.top - relativeRect.top; const left = elRect.left - relativeRect.left; return { top, left, bottom: top + elRect.height, right: left + elRect.width, } } function scrollToTargetAndHighlight(event) { let hash = event.target.hash; if (hash) { hash = decodeURIComponent(hash.substring(1)); const dest = document.getElementById(hash); if (dest) { dest.classList.add('highlighted'); setTimeout(() => dest.classList.remove('highlighted'), 1000); } } } // Functions, divided by link type, that wrap an autolink's // contents with the appropriate outer syntax. // Alternately, a string naming another type they format // the same as. function needsFor(type) { switch(type) { case "descriptor": case "value": case "element-attr": case "attr-value": case "element-state": case "method": case "constructor": case "argument": case "attribute": case "const": case "dict-member": case "event": case "enum-value": case "stringifier": case "serializer": case "iterator": case "maplike": case "setlike": case "state": case "mode": case "context": case "facet": return true; default: return false; } } function refusesFor(type) { switch(type) { case "property": case "element": case "interface": case "namespace": case "callback": case "dictionary": case "enum": case "exception": case "typedef": case "http-header": case "permission": return true; default: return false; } } function linkFormatterFromType(type) { switch(type) { case 'scheme': case 'permission': case 'dfn': return (text) => `[=${text}=]`; case 'abstract-op': return (text) => `[\$${text}\$]`; case 'function': case 'at-rule': case 'selector': case 'value': return (text) => `''${text}''`; case 'http-header': return (text) => `[:${text}:]`; case 'interface': case 'constructor': case 'method': case 'argument': case 'attribute': case 'callback': case 'dictionary': case 'dict-member': case 'enum': case 'enum-value': case 'exception': case 'const': case 'typedef': case 'stringifier': case 'serializer': case 'iterator': case 'maplike': case 'setlike': case 'extended-attribute': case 'event': case 'idl': return (text) => `{{${text}}}`; case 'element-state': case 'element-attr': case 'attr-value': case 'element': return (element) => `<{${element}}>`; case 'grammar': return (text) => `${text} (within a <pre class=prod>)`; case 'type': return (text)=> `<<${text}>>`; case 'descriptor': case 'property': return (text) => `'${text}'`; default: return; }; }; function genLinkingSyntaxes(dfn) { if(dfn.tagName != "DFN") return; const type = dfn.getAttribute('data-dfn-type'); if(!type) { console.log(`<dfn> doesn't have a data-dfn-type:`, dfn); return []; } // Return a function that wraps link text based on the type const linkFormatter = linkFormatterFromType(type); if(!linkFormatter) { console.log(`<dfn> has an unknown data-dfn-type:`, dfn); return []; } let ltAlts; if(dfn.hasAttribute('data-lt')) { ltAlts = dfn.getAttribute('data-lt') .split("|") .map(x=>x.trim()); } else { ltAlts = [dfn.textContent.trim()]; } if(type == "type") { // lt of "<foo>", but "foo" is the interior; // <<foo/bar>> is how you write it with a for, // not <foo/<bar>> or whatever. for(var i = 0; i < ltAlts.length; i++) { const lt = ltAlts[i]; const match = /<(.*)>/.exec(lt); if(match) { ltAlts[i] = match[1]; } } } let forAlts; if(dfn.hasAttribute('data-dfn-for')) { forAlts = dfn.getAttribute('data-dfn-for') .split(",") .map(x=>x.trim()); } else { forAlts = ['']; } let linkingSyntaxes = []; if(!needsFor(type)) { for(const lt of ltAlts) { linkingSyntaxes.push(linkFormatter(lt)); } } if(!refusesFor(type)) { for(const f of forAlts) { linkingSyntaxes.push(linkFormatter(`${f}/${ltAlts[0]}`)) } } return [ mk.b({}, 'Possible linking syntaxes:'), mk.ul({}, ...linkingSyntaxes.map(link => { const copyLink = async () => await navigator.clipboard.writeText(link); return mk.li({}, mk.div({ class: 'link-item' }, mk.button({ class: 'copy-icon', title: 'Copy', type: 'button', _onclick: copyLink, tabindex: 0, }, mk.span({ class: 'icon' }) ), mk.span({}, link) ) ); }) ) ]; } } </script> <script>/* Boilerplate: script-link-titles */ "use strict"; { let linkTitleData = { "#typedef-content-content-list": "Expands to: <image> | <string> | attr() | close-quote | contents | leader() | no-close-quote | no-open-quote | open-quote", "#typedef-quote": "Expands to: close-quote | no-close-quote | no-open-quote | open-quote", "https://drafts.csswg.org/css-counter-styles-3/#typedef-counter-style": "Expands to: cjk-ideographic | japanese-formal | japanese-informal | simp-chinese-formal | simp-chinese-informal | trad-chinese-formal | trad-chinese-informal", "https://drafts.csswg.org/css-values-4/#url-value": "Expands to: local url flag", }; function setTypeTitles() { for(let el of document.querySelectorAll("a[href]")) { if(el.href in linkTitleData && !el.hasAttribute("title")) { el.setAttribute("title", linkTitleData[el.href]); } } } document.addEventListener("DOMContentLoaded", setTypeTitles); } </script> <script>/* Boilerplate: script-position-annos */ "use strict"; { function repositionAnnoPanels(){ const panels = [...document.querySelectorAll("[data-anno-for]")]; hydratePanels(panels); let vSoFar = 0; for(const panel of panels.sort(cmpTops)) { if(panel.top < vSoFar) { panel.top = vSoFar; panel.style.top = vSoFar + "px"; } vSoFar = panel.top + panel.height + 15; } } function hydratePanels(panels) { const main = document.querySelector("main"); let mainRect; if(main) mainRect = main.getBoundingClientRect(); // First display them all, if they're not already visible. for(const panel of panels) { panel.classList.remove("unpositioned"); } // Measure them all for(const panel of panels) { const dfn = document.getElementById(panel.getAttribute("data-anno-for")); if(!dfn) { console.log("Can't find the annotation panel target:", panel); continue; } panel.dfn = dfn; panel.top = window.scrollY + dfn.getBoundingClientRect().top; let panelRect = panel.getBoundingClientRect(); panel.height = panelRect.height; if(main) { panel.overlappingMain = panelRect.left < mainRect.right; } else { panel.overlappingMain = false; } } // And finally position them for(const panel of panels) { const dfn = panel.dfn; if(!dfn) continue; panel.style.top = panel.top + "px"; panel.classList.toggle("overlapping-main", panel.overlappingMain); } } function cmpTops(a,b) { return a.top - b.top; } window.addEventListener("load", repositionAnnoPanels); window.addEventListener("resize", repositionAnnoPanels); } </script> <script>/* Boilerplate: script-ref-hints */ "use strict"; { let refsData = { "#entry-value": {"displayText":"entry value","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"entry value","type":"dfn","url":"#entry-value"}, "#exit-value": {"displayText":"exit value","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"exit value","type":"dfn","url":"#exit-value"}, "#funcdef-content": {"displayText":"content()","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"content()","type":"function","url":"#funcdef-content"}, "#funcdef-content-leader": {"displayText":"leader()","export":true,"for_":["<content-list>","content"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"leader()","type":"function","url":"#funcdef-content-leader"}, "#funcdef-string": {"displayText":"string()","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"string()","type":"function","url":"#funcdef-string"}, "#funcdef-target-counter": {"displayText":"target-counter()","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"target-counter()","type":"function","url":"#funcdef-target-counter"}, "#funcdef-target-counters": {"displayText":"target-counters()","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"target-counters()","type":"function","url":"#funcdef-target-counters"}, "#named-string": {"displayText":"named string","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"named string","type":"dfn","url":"#named-string"}, "#propdef-bookmark-label": {"displayText":"bookmark-label","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"bookmark-label","type":"property","url":"#propdef-bookmark-label"}, "#propdef-bookmark-level": {"displayText":"bookmark-level","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"bookmark-level","type":"property","url":"#propdef-bookmark-level"}, "#propdef-bookmark-state": {"displayText":"bookmark-state","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"bookmark-state","type":"property","url":"#propdef-bookmark-state"}, "#propdef-content": {"displayText":"content","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"content","type":"property","url":"#propdef-content"}, "#propdef-quotes": {"displayText":"quotes","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"quotes","type":"property","url":"#propdef-quotes"}, "#propdef-string-set": {"displayText":"string-set","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"string-set","type":"property","url":"#propdef-string-set"}, "#quotation-mark-system": {"displayText":"quotation mark system","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"quotation mark system","type":"dfn","url":"#quotation-mark-system"}, "#quote-depth": {"displayText":"quote depth","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"quote depth","type":"dfn","url":"#quote-depth"}, "#target-text-function": {"displayText":"target-text()","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"target-text()","type":"function","url":"#target-text-function"}, "#typedef-content-content-list": {"displayText":"<content-list>","export":true,"for_":["content"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"<content-list>","type":"type","url":"#typedef-content-content-list"}, "#typedef-content-content-replacement": {"displayText":"<content-replacement>","export":true,"for_":["content"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"<content-replacement>","type":"type","url":"#typedef-content-content-replacement"}, "#typedef-leader-type": {"displayText":"<leader-type>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"<leader-type>","type":"type","url":"#typedef-leader-type"}, "#typedef-quote": {"displayText":"<quote>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"<quote>","type":"type","url":"#typedef-quote"}, "#typedef-target": {"displayText":"<target>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"<target>","type":"type","url":"#typedef-target"}, "#valdef-bookmark-level-none": {"displayText":"none","export":true,"for_":["bookmark-level"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"none","type":"value","url":"#valdef-bookmark-level-none"}, "#valdef-content-close-quote": {"displayText":"close-quote","export":true,"for_":["<content-list>","<quote>","content"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"close-quote","type":"value","url":"#valdef-content-close-quote"}, "#valdef-content-contents": {"displayText":"contents","export":true,"for_":["<content-list>","content"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"contents","type":"value","url":"#valdef-content-contents"}, "#valdef-content-none": {"displayText":"none","export":true,"for_":["content"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"none","type":"value","url":"#valdef-content-none"}, "#valdef-content-normal": {"displayText":"normal","export":true,"for_":["content"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"normal","type":"value","url":"#valdef-content-normal"}, "#valdef-content-open-quote": {"displayText":"open-quote","export":true,"for_":["<content-list>","<quote>","content"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"open-quote","type":"value","url":"#valdef-content-open-quote"}, "#valdef-content-text": {"displayText":"text","export":true,"for_":["content()"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"text","type":"value","url":"#valdef-content-text"}, "#valdef-quotes-auto": {"displayText":"auto","export":true,"for_":["quotes"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"auto","type":"value","url":"#valdef-quotes-auto"}, "#valdef-quotes-match-parent": {"displayText":"match-parent","export":true,"for_":["quotes"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"match-parent","type":"value","url":"#valdef-quotes-match-parent"}, "#valdef-quotes-none": {"displayText":"none","export":true,"for_":["quotes"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"none","type":"value","url":"#valdef-quotes-none"}, "#valdef-string-first": {"displayText":"first","export":true,"for_":["string()"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"first","type":"value","url":"#valdef-string-first"}, "#valdef-string-set-none": {"displayText":"none","export":true,"for_":["string-set"],"level":"3","normative":true,"shortname":"css-content","spec":"css-content-3","status":"local","text":"none","type":"value","url":"#valdef-string-set-none"}, "https://drafts.csswg.org/css-cascade-5/#computed-value": {"displayText":"computed value","export":true,"for_":[],"level":"5","normative":true,"shortname":"css-cascade","spec":"css-cascade-5","status":"current","text":"computed value","type":"dfn","url":"https://drafts.csswg.org/css-cascade-5/#computed-value"}, "https://drafts.csswg.org/css-contain-2/#style-containment": {"displayText":"style containment","export":true,"for_":[],"level":"2","normative":true,"shortname":"css-contain","spec":"css-contain-2","status":"current","text":"style containment","type":"dfn","url":"https://drafts.csswg.org/css-contain-2/#style-containment"}, "https://drafts.csswg.org/css-counter-styles-3/#typedef-counter-style": {"displayText":"<counter-style>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-counter-styles","spec":"css-counter-styles-3","status":"current","text":"<counter-style>","type":"type","url":"https://drafts.csswg.org/css-counter-styles-3/#typedef-counter-style"}, "https://drafts.csswg.org/css-display-4/#propdef-display": {"displayText":"display","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-display","spec":"css-display-4","status":"current","text":"display","type":"property","url":"https://drafts.csswg.org/css-display-4/#propdef-display"}, "https://drafts.csswg.org/css-images-3/#natural-dimensions": {"displayText":"natural dimension","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-images","spec":"css-images-3","status":"current","text":"natural dimension","type":"dfn","url":"https://drafts.csswg.org/css-images-3/#natural-dimensions"}, "https://drafts.csswg.org/css-images-3/#typedef-image": {"displayText":"<image>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-images","spec":"css-images-3","status":"current","text":"<image>","type":"type","url":"https://drafts.csswg.org/css-images-3/#typedef-image"}, "https://drafts.csswg.org/css-images-4/#invalid-image": {"displayText":"invalid image","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-images","spec":"css-images-4","status":"current","text":"invalid image","type":"dfn","url":"https://drafts.csswg.org/css-images-4/#invalid-image"}, "https://drafts.csswg.org/css-lists-3/#typedef-counter": {"displayText":"<counter>","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-lists","spec":"css-lists-3","status":"current","text":"<counter>","type":"type","url":"https://drafts.csswg.org/css-lists-3/#typedef-counter"}, "https://drafts.csswg.org/css-namespaces-3/#css-qualified-name": {"displayText":"CSS qualified name","export":true,"for_":[],"level":"3","normative":true,"shortname":"css-namespaces","spec":"css-namespaces-3","status":"current","text":"css qualified name","type":"dfn","url":"https://drafts.csswg.org/css-namespaces-3/#css-qualified-name"}, "https://drafts.csswg.org/css-pseudo-4/#selectordef-after": {"displayText":"::after","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-pseudo","spec":"css-pseudo-4","status":"current","text":"::after","type":"selector","url":"https://drafts.csswg.org/css-pseudo-4/#selectordef-after"}, "https://drafts.csswg.org/css-pseudo-4/#selectordef-before": {"displayText":"::before","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-pseudo","spec":"css-pseudo-4","status":"current","text":"::before","type":"selector","url":"https://drafts.csswg.org/css-pseudo-4/#selectordef-before"}, "https://drafts.csswg.org/css-pseudo-4/#selectordef-file-selector-button": {"displayText":"::file-selector-button","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-pseudo","spec":"css-pseudo-4","status":"current","text":"::file-selector-button","type":"selector","url":"https://drafts.csswg.org/css-pseudo-4/#selectordef-file-selector-button"}, "https://drafts.csswg.org/css-pseudo-4/#selectordef-first-letter": {"displayText":"::first-letter","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-pseudo","spec":"css-pseudo-4","status":"current","text":"::first-letter","type":"selector","url":"https://drafts.csswg.org/css-pseudo-4/#selectordef-first-letter"}, "https://drafts.csswg.org/css-pseudo-4/#selectordef-marker": {"displayText":"::marker","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-pseudo","spec":"css-pseudo-4","status":"current","text":"::marker","type":"selector","url":"https://drafts.csswg.org/css-pseudo-4/#selectordef-marker"}, "https://drafts.csswg.org/css-pseudo-4/#selectordef-placeholder": {"displayText":"::placeholder","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-pseudo","spec":"css-pseudo-4","status":"current","text":"::placeholder","type":"selector","url":"https://drafts.csswg.org/css-pseudo-4/#selectordef-placeholder"}, "https://drafts.csswg.org/css-text-4/#content-language": {"displayText":"content language","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-text","spec":"css-text-4","status":"current","text":"content language","type":"dfn","url":"https://drafts.csswg.org/css-text-4/#content-language"}, "https://drafts.csswg.org/css-text-4/#white-space": {"displayText":"white space","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-text","spec":"css-text-4","status":"current","text":"white space","type":"dfn","url":"https://drafts.csswg.org/css-text-4/#white-space"}, "https://drafts.csswg.org/css-values-4/#comb-comma": {"displayText":",","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":",","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#comb-comma"}, "https://drafts.csswg.org/css-values-4/#comb-one": {"displayText":"|","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"|","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#comb-one"}, "https://drafts.csswg.org/css-values-4/#css-wide-keywords": {"displayText":"CSS-wide keywords","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"css-wide keywords","type":"dfn","url":"https://drafts.csswg.org/css-values-4/#css-wide-keywords"}, "https://drafts.csswg.org/css-values-4/#identifier-value": {"displayText":"<custom-ident>","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"<custom-ident>","type":"type","url":"https://drafts.csswg.org/css-values-4/#identifier-value"}, "https://drafts.csswg.org/css-values-4/#integer-value": {"displayText":"<integer>","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"<integer>","type":"type","url":"https://drafts.csswg.org/css-values-4/#integer-value"}, "https://drafts.csswg.org/css-values-4/#mult-comma": {"displayText":"#","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"#","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#mult-comma"}, "https://drafts.csswg.org/css-values-4/#mult-one-plus": {"displayText":"+","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"+","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#mult-one-plus"}, "https://drafts.csswg.org/css-values-4/#mult-opt": {"displayText":"?","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"?","type":"grammar","url":"https://drafts.csswg.org/css-values-4/#mult-opt"}, "https://drafts.csswg.org/css-values-4/#string-value": {"displayText":"<string>","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"<string>","type":"type","url":"https://drafts.csswg.org/css-values-4/#string-value"}, "https://drafts.csswg.org/css-values-4/#url-value": {"displayText":"<url>","export":true,"for_":[],"level":"4","normative":true,"shortname":"css-values","spec":"css-values-4","status":"current","text":"<url>","type":"type","url":"https://drafts.csswg.org/css-values-4/#url-value"}, "https://drafts.csswg.org/css-values-5/#funcdef-attr": {"displayText":"attr()","export":true,"for_":[],"level":"5","normative":true,"shortname":"css-values","spec":"css-values-5","status":"current","text":"attr()","type":"function","url":"https://drafts.csswg.org/css-values-5/#funcdef-attr"}, "https://drafts.csswg.org/selectors-4/#originating-element": {"displayText":"originating element","export":true,"for_":[],"level":"4","normative":true,"shortname":"selectors","spec":"selectors-4","status":"current","text":"originating element","type":"dfn","url":"https://drafts.csswg.org/selectors-4/#originating-element"}, "https://drafts.csswg.org/selectors-4/#target-pseudo": {"displayText":":target","export":true,"for_":[],"level":"4","normative":true,"shortname":"selectors","spec":"selectors-4","status":"current","text":":target","type":"selector","url":"https://drafts.csswg.org/selectors-4/#target-pseudo"}, "https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element": {"displayText":"img","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"img","type":"element","url":"https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element"}, "https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-q-element": {"displayText":"q","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"q","type":"element","url":"https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-q-element"}, "https://www.w3.org/TR/CSS21/selector.html#x22": {"displayText":"pseudo-elements","export":true,"for_":[],"level":"1","normative":true,"shortname":"css","spec":"css21","status":"current","text":"pseudo-elements","type":"dfn","url":"https://www.w3.org/TR/CSS21/selector.html#x22"}, }; function mkRefHint(link, ref) { const linkText = link.textContent; let dfnTextElements = ''; if (ref.displayText.toLowerCase() != linkText.toLowerCase()) { // Give the original term if it's being displayed in a different way. // But allow casing differences, they're insignificant. dfnTextElements = mk.li({}, mk.b({}, "Term: "), mk.span({}, ref.displayText) ); } const forList = ref.for_; let forListElements; if(forList.length == 0) { forListElements = []; } else if(forList.length == 1) { forListElements = mk.li({}, mk.b({}, "For: "), mk.span({}, forList[0]), ); } else { forListElements = mk.li({}, mk.b({}, "For: "), mk.ul({}, ...forList.map(forItem => mk.li({}, mk.span({}, forItem) ), ), ), ); } const url = ref.url; const safeUrl = encodeURIComponent(url); const hintPanel = mk.aside({ class: "ref-hint", id: `ref-hint-for-${safeUrl}`, "data-for": url, "aria-labelled-by": `ref-hint-for-${safeUrl}`, }, mk.ul({}, dfnTextElements, mk.li({}, mk.b({}, "URL: "), mk.a({ href: url, class: "ref" }, url), ), mk.li({}, mk.b({}, "Type: "), mk.span({}, `${ref.type}`), ), mk.li({}, mk.b({}, "Spec: "), mk.span({}, `${ref.spec ? ref.spec : ''}`), ), forListElements ), ); hintPanel.forLink = link; setupRefHintEventListeners(link, hintPanel); return hintPanel; } function hideAllRefHints() { queryAll(".ref-hint").forEach(el=>hideRefHint(el)); } function hideRefHint(refHint) { const link = refHint.forLink; link.setAttribute("aria-expanded", "false"); if(refHint.teardownEventListeners) { refHint.teardownEventListeners(); } refHint.remove(); } function showRefHint(link) { if(link.classList.contains("dfn-link")) return; const url = link.getAttribute("href"); const ref = refsData[url]; if(!ref) return; hideAllRefHints(); // Only display one at this time. const refHint = mkRefHint(link, ref); append(document.body, refHint); link.setAttribute("aria-expanded", "true"); positionRefHint(refHint); } function setupRefHintEventListeners(link, refHint) { if (refHint.teardownEventListeners) return; // Add event handlers to hide the refHint after the user moves away // from both the link and refHint, if not hovering either within one second. let timeout = null; const startHidingRefHint = (event) => { if (timeout) { clearTimeout(timeout); } timeout = setTimeout(() => { hideRefHint(refHint); }, 1000); } const resetHidingRefHint = (event) => { if (timeout) clearTimeout(timeout); timeout = null; }; link.addEventListener("mouseleave", startHidingRefHint); link.addEventListener("mouseenter", resetHidingRefHint); link.addEventListener("blur", startHidingRefHint); link.addEventListener("focus", resetHidingRefHint); refHint.addEventListener("mouseleave", startHidingRefHint); refHint.addEventListener("mouseenter", resetHidingRefHint); refHint.addEventListener("blur", startHidingRefHint); refHint.addEventListener("focus", resetHidingRefHint); refHint.teardownEventListeners = () => { // remove event listeners resetHidingRefHint(); link.removeEventListener("mouseleave", startHidingRefHint); link.removeEventListener("mouseenter", resetHidingRefHint); link.removeEventListener("blur", startHidingRefHint); link.removeEventListener("focus", resetHidingRefHint); refHint.removeEventListener("mouseleave", startHidingRefHint); refHint.removeEventListener("mouseenter", resetHidingRefHint); refHint.removeEventListener("blur", startHidingRefHint); refHint.removeEventListener("focus", resetHidingRefHint); }; } function positionRefHint(refHint) { const link = refHint.forLink; const linkPos = getBounds(link); refHint.style.top = linkPos.bottom + "px"; refHint.style.left = linkPos.left + "px"; const panelPos = refHint.getBoundingClientRect(); const panelMargin = 8; const maxRight = document.body.parentNode.clientWidth - panelMargin; if (panelPos.right > maxRight) { const overflowAmount = panelPos.right - maxRight; const newLeft = Math.max(panelMargin, linkPos.left - overflowAmount); refHint.style.left = newLeft + "px"; } } // TODO: shared util // Returns the root-level absolute position {left and top} of element. function getBounds(el, relativeTo=document.body) { const relativeRect = relativeTo.getBoundingClientRect(); const elRect = el.getBoundingClientRect(); const top = elRect.top - relativeRect.top; const left = elRect.left - relativeRect.left; return { top, left, bottom: top + elRect.height, right: left + elRect.width, } } function showRefHintListener(e) { // If the target isn't in a link (or is a link), // just ignore it. let link = e.target.closest("a"); if(!link) return; // If the target is in a ref-hint panel // (aka a link in the already-open one), // also just ignore it. if(link.closest(".ref-hint")) return; // Otherwise, show the panel for the link. showRefHint(link); } function hideAllHintsListener(e) { // If the click is inside a ref-hint panel, ignore it. if(e.target.closest(".ref-hint")) return; // Otherwise, close all the current panels. hideAllRefHints(); } document.addEventListener("DOMContentLoaded", () => { document.body.addEventListener("mousedown", showRefHintListener); document.body.addEventListener("focus", showRefHintListener); document.body.addEventListener("click", hideAllHintsListener); }); window.addEventListener("resize", () => { // Hide any open ref hint. hideAllRefHints(); }); } </script>

Pages: 1 2 3 4 5 6 7 8 9 10