`column-rule-inset-junction-end` CSS property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{SeeCompatTable}}
The **column-rule-inset-junction-end** CSS property can be used to offset the bottom endpoints of column rule segments that are junction endpoints; that is, endpoints at gap junctions where rule segments intersect.
{{InteractiveExample("CSS Demo: column-rule-inset-junction-end")}}
column-rule-inset-junction-end: 0;column-rule-inset-junction-end: 0.5em;column-rule-inset-junction-end: 10px;column-rule-inset-junction-end: -100%;column-rule-inset-junction-end: overlap-join;<section id="default-example">
<div id="example-element">
<i>A</i>
<i>B</i>
<i>C</i>
<i>D</i>
<i>E</i>
<i>F</i>
<i>G</i>
<i>H</i>
<i>I</i>
<i>J</i>
<i>K</i>
<i>L</i>
</div>
</section>#example-element {
display: grid;
grid-template-columns: repeat(5, 1fr);
rule: solid thick lightpink;
column-rule-color: magenta;
column-rule-break: intersection;
gap: 1.5em;
rule-overlap: column-over-row;
border: 1px solid rebeccapurple;
margin: auto;
rule-visibility-items: around;
}
#example-element i {
background-color: #efefef;
color: #333333;
padding: 1em;
}Syntax
/* Keywords */
column-rule-inset-junction-end: overlap-join;
/* <length-percentage> values */
column-rule-inset-junction-end: 0;
column-rule-inset-junction-end: 1em;
column-rule-inset-junction-end: -5px;
column-rule-inset-junction-end: -25%;
/* Global values */
column-rule-inset-junction-end: inherit;
column-rule-inset-junction-end: initial;
column-rule-inset-junction-end: revert;
column-rule-inset-junction-end: revert-layer;
column-rule-inset-junction-end: unset;Values
This property is specified as a single value from the following list:
overlap-join- : Specifies that the junction segment should extend across the row-rule, resolving to half the {{cssxref("row-gap")}} value plus half the used {{cssxref("row-rule-width")}} value.
- {{cssxref("length-percentage")}}
- : Specifies the size of the inset. Percentage values are relative to the junction endpoint, which is the
row-gapvalue.
Description
The column-rule-inset-junction-end property can be used to inset or outset junction segment endpoints occurring at the bottom of column rule segments. The default value is 0. Positive values reduce the segment size, while negative values and [the overlap-join keyword](#the_overlap-join_value) increase it.
Column rules are painted within a column gap as one or more segments, with segments occurring between:
- Adjacent columns in CSS grid layouts.
- Adjacent flex items or flex lines in flex layouts, depending on the
flex-direction. - Adjacent columns in multi-col layouts.
Whether a column rule spans multiple rows or is broken into multiple segments is defined by the {{cssxref("column-rule-break")}} property; interior breaks between column rule segments are the size of the {{cssxref("row-gap")}}. A junction end occurs at the bottom of every column segment where the segment's bottom ends at a gap junction with other column or rule segments present.
The column-rule-inset-junction-end property is a constituent property of several shorthand properties:
- To inset the top and bottom column segment junction endpoints, the
column-rule-inset-junction-endproperty, along with the {{cssxref("column-rule-inset-junction-start")}} property, can be set using the {{cssxref("column-rule-inset-junction")}} shorthand.
- To inset all bottom column segment endpoints, the
column-rule-inset-junction-endproperty, along with the {{cssxref("column-rule-inset-cap-end")}} property, can be set using the {{cssxref("column-rule-inset-end")}} shorthand.
- To inset the top, bottom, left, and right segment junction endpoints the
column-rule-inset-junctionshorthand property, along with the {{cssxref("row-rule-inset-junction")}} shorthand property, can be set using the {{cssxref("rule-inset-junction")}} shorthand.
All segment endpoints, including this property's -start, -cap, and row- equivalents, can be set using the {{cssxref("rule-inset")}} shorthand.
Understanding junction endpoints
A _junction segment endpoint_ is any segment endpoint at an interior gap that ends at a gap intersection where other rule or column segments are present. The column-rule-inset-junction-end property controls the inset of the bottom edge of column junction segments, allowing the segments to be shrunk or extended.
Length column-rule-inset-junction-end values inset segments by the specified value. Negative length values create an outset, extending the bottom end of the junction segment. Percentage values are relative to the size of the {{cssxref("row-gap")}}. Setting -50% outsets the bottom of the junction segment half way through the row gap below the segment, no matter how wide the row gap is.
In the following demonstration, the column rule segments in the top two rows end in junction endpoints. With column-rule-inset-junction-end: 16px set, the bottom, or end, of these segments are inset by 16px. Change the inset <length> value to better visualize which segments end in junction segment endpoints.
{{EmbedLiveSample("junctions", "", "300")}}
If you set 0px as the value, the end of the column rules will align with the end of the row, abutting the row gap. This is the default. Note how only the bottom ends of the segments in the middle of the grid change when the property value changes. The segments in the bottom row do not change: these are _cap endpoints_, and are not affected by the column-rule-inset-junction-end property.
Select around as the rule-visibility-items value. This value paints rules in a gap segment if an item occupies at least one of the two adjacent areas. The double line-style column rule segments that appear when the rule-visibility-items property is set to around end at an interior intersection where one or more row-rule segments are present; these column segments are junction segment endpoints.
Select between as the rule-visibility-items value, which paints rules in gap segments only if items occupy both adjacent areas. The double line-style column rule segments now end at an interior intersection where no other rule segments are present: these column segments are _cap segment endpoints_ and therefore aren't affected by the column-rule-inset-junction-end property.
The overlap-join value
The overlap-join value outsets the bottom end of interior segments so they align with the bottom of the intersected row-rule. The value resolves to half the {{cssxref("row-gap")}} size (extending it to the middle of the gap) plus half the row rule width.
When column-rule-inset-junction-end is set to the overlap-join keyword value, the junction end segments extend down into the row gap to meet, or "join", the bottom edge of the row rule painted in that gap.
In the following live example, column-rule-inset-junction-end is set to overlap-join:
{{EmbedLiveSample("the overlap-join value", "", "430")}}
Change the size of the {{cssxref("row-rule-width")}} and the {{cssxref("row-gap")}}. Notice how, no matter the size of the gap or row rule, the bottom end of the column segment is always stretched to align with the bottom of the row rule painted in the gap.
Formal definition
{{cssinfo}}
Formal syntax
{{csssyntax}}
Examples
Basic usage
This example demonstrates setting column-rule-inset-junction-end to inset the end edge of column junction segments on flex containers.
HTML
The markup includes two {{htmlelement("div")}} elements, each containing seven children. The only difference between the two containers is that the second one has an added column class.
<h1>Insetting junction column rule endpoints</h1>
<article>
<section>
<h2>flex-direction: row</h2>
<div class="flexbox">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</section>
<section>
<h2>flex-direction: column</h2>
<div class="flexbox column">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</section>
</article>CSS
We use the {{cssxref("display")}} property to turn the .flexbox elements into flex containers. We balance the items into three flex lines using {{cssxref("flex-wrap")}} and {{cssxref("flex-line-count")}}. We define a light blue {{cssxref("rule")}} to paint both row and column gaps, then overwrite the {{cssxref("column-rule-color")}}, setting darker blue column gap decorations. We also set the {{cssxref("rule-overlap")}} property to column-over-row to ensure the column segments are drawn on top of the row segments when the segments overlap. Finally, we set the column-rule-inset-junction-end to 16px.
.flexbox {
display: flex;
flex-wrap: balance;
flex-line-count: 3;
gap: 20px;
rule: 5px solid lightblue;
column-rule-color: blue;
rule-overlap: column-over-row;
column-rule-inset-junction-end: 16px;
}We also set the {{cssxref("flex-direction")}} on the .column container to column, changing the main axis of the flex container to run up and down the page and making the items flow in columns rather than rows.
.column {
flex-direction: column;
}The rest of the CSS is hidden for brevity.
Result
{{EmbedLiveSample("Basic usage", "", "330")}}
Change the size of the inset. Note that this property affects only column rules split into multiple segments. When a column rule is a single segment that spans the height of the container, the segment has two cap endpoints and no junction endpoints, and remains unaffected by changes to the column-rule-inset-junction-end value.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- {{cssxref("column-rule-inset-junction-start")}}
- {{cssxref("column-rule-inset-junction")}} shorthand
- {{cssxref("column-rule-inset")}} shorthand
- {{cssxref("rule-inset")}} shorthand
- {{cssxref("column-rule-break")}}
- {{cssxref("rule-break")}} shorthand
- {{cssxref("rule-overlap")}}
- {{cssxref("rule-visibility-items")}}
- {{cssxref("rule")}} shorthand
- CSS gaps module