You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><ahref=#the-display-extras><spanclass=secno>2.3</span> Additional stuff: the <spanclass=propertydata-link-type=propdesctitle=display-extras>display-extras</span> property</a>
118
118
<li><ahref=#the-display><spanclass=secno>2.4</span> The <spanclass=propertydata-link-type=propdesctitle=display>display</span> shorthand property</a></ul>
119
119
<li><ahref=#the-display-box><spanclass=secno>3</span> Controlling box generation: the <spanclass=propertydata-link-type=propdesctitle=display-box>display-box</span> property</a>
The element is an <dfnclass=css-codedata-dfn-for=display-outsidedata-dfn-type=valuedata-export="" id=valuedef-internal-ruby-element>internal ruby element<aclass=self-linkhref=#valuedef-internal-ruby-element></a></dfn>,
268
269
and participates in a ruby layout context. <adata-biblio-type=normativedata-link-type=bibliohref=#css3rubytitle=css3ruby>[CSS3RUBY]</a>
269
270
These values are all <adata-link-type=dfnhref=#layout-specific-display-roletitle="layout-specific display roles">layout-specific display roles</a>.
The element is a <adata-link-type=dfnhref=#run-in-elementtitle="run-in element">run-in element</a>.
275
+
Run-in elements act like inlines or blocks,
276
+
depending on the surrounding elements.
277
+
This is described more fully in a later section.
270
278
</dl>
271
279
272
280
<p> Some values of <aclass=propertydata-link-type=propdeschref=#propdef-display-outsidetitle=display-outside>display-outside</a> are specialized for particular formatting contexts,
<p> A <dfndata-dfn-type=dfndata-noexport="" id=run-in-element>run-in element<aclass=self-linkhref=#run-in-element></a></dfn> is an element with <aclass=cssdata-link-type=propdeschref=#propdef-display-outsidetitle=display-outside>display-outside: run-in</a>.
419
+
A <adata-link-type=dfnhref=#run-in-elementtitle="run-in element">run-in element</a> acts differently based on whether its siblings are inlines or blocks;
420
+
if it precedes a block, it <em>merges into</em> the block.
421
+
This is useful for formatting compact headlines, definitions, and other similar things,
422
+
where the appropriate DOM structure is to have a headline preceding the following prose,
423
+
but the desired display is an inline headline laying out with the text.
424
+
425
+
<divclass=example>
426
+
For example, dictionary definitions are often formatted so that the word is inline with the definition:
427
+
428
+
<pre><dl class='dict'>
429
+
<dt>dictionary
430
+
<dd>a book that lists the words of a language in alphabetical
431
+
order and gives their meaning, or that gives the equivalent
432
+
words in a different language.
433
+
<dt>glossary
434
+
<dd>an alphabetical list of terms or words found in or relating
435
+
to a specific subject, text, or dialect, with explanations; a
436
+
brief dictionary.
437
+
</dl>
438
+
<style>
439
+
.dict > dt {
440
+
display: run-in;
441
+
}
442
+
.dict > dt::after {
443
+
display: run-in;
444
+
content: ": "
445
+
}
446
+
</style>
447
+
</pre>
448
+
<p> Which is formatted as:
449
+
450
+
<pre><b>dictionary:</b> a book that lists the words of a language
451
+
in alphabetical order and explains their meaning.
452
+
453
+
<b>glossary:</b> an alphabetical list of terms or words found
454
+
in or relating to a specific subject, text, or dialect,
455
+
with explanations; a brief dictionary.
456
+
</pre></div>
457
+
458
+
<p> Whenever there is a sequence of one or more contiguous sibling <adata-link-type=dfnhref=#run-in-elementtitle="run-in elements">run-in elements</a>,
459
+
if the sequence is followed by an element with <aclass=cssdata-link-type=propdeschref=#propdef-display-insidetitle=display-inside>display-inside: block</a> and <aclass=cssdata-link-type=propdeschref=#propdef-display-outsidetitle=display-outside>display-outside: block-level</a>,
460
+
all of the elements in the sequence generate inline-level boxes inside the following block,
461
+
as if they were <aclass=cssdata-link-type=propdeschref=#propdef-display-outsidetitle=display-outside>display-outside: inline-level</a>,
462
+
after its <aclass=cssdata-link-type=maybehref=http://dev.w3.org/csswg/css-lists-3/#selectordef-markertitle=::marker>::marker</a> pseudo-element’s boxes (if any),
463
+
but preceding any other boxes generates by the contents of the block
464
+
(including the box generated by the <spanclass=cssdata-link-type=maybetitle=::before>::before</span> pseudo-element, if any).
465
+
466
+
<p> Otherwise, the behavior depends on how many sibling <adata-link-type=dfnhref=#run-in-elementtitle="run-in elements">run-in elements</a> are in the sequence:
467
+
468
+
<dl>
469
+
<dt>only one
470
+
<dd>
471
+
The <adata-link-type=dfnhref=#run-in-elementtitle="run-in element">run-in element</a> generates a block-level box,
472
+
as if it were <aclass=cssdata-link-type=propdeschref=#propdef-display-outsidetitle=display-outside>display-outside: block-level</a>.
473
+
474
+
<dt>more than one
475
+
<dd>
476
+
Each <adata-link-type=dfnhref=#run-in-elementtitle="run-in element">run-in element</a> generates an inline-level box,
477
+
as if it were <aclass=cssdata-link-type=propdeschref=#propdef-display-outsidetitle=display-outside>display-outside: inline-level</a>.
478
+
An anonymous block box is generated around the entire sequence of boxes thus generated.
0 commit comments