column-rule-inset-junction-end CSS property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Want more browser support for this feature? Tell us why.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
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.
Try it
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;
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 the junction segment should extend across the row-rule, resolving to half the
row-gapvalue plus half the usedrow-rule-widthvalue. <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 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 column-rule-break property; interior breaks between column rule segments are the size of the 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 top and bottom column segment junction endpoints, the
column-rule-inset-junction-endproperty, along with thecolumn-rule-inset-junction-startproperty, can be set using thecolumn-rule-inset-junctionshorthand. -
To inset all bottom column segment endpoints, the
column-rule-inset-junction-endproperty, along with thecolumn-rule-inset-cap-endproperty, can be set using thecolumn-rule-inset-endshorthand. -
To inset bottom column segment junction endpoints and right row segment junction endpoints, the
column-rule-inset-junction-endproperty, along with therow-rule-inset-junction-endproperty, can be set using therule-inset-junction-endshorthand.
All segment endpoints, including this property's -start, -cap, and row- equivalents, can be set using the 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 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.
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 row-gap size (which would extend 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 bottom ends of 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:
Change the size of the row-rule-width and the 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
Value not found in DB!Formal syntax
column-rule-inset-junction-end =
<inset-value>
<inset-value> =
<length-percentage> |
overlap-join
<length-percentage> =
<length> |
<percentage>
Examples
>Basic usage
This example demonstrates setting column-rule-inset-junction-end to inset the end edge of junction segments on flex containers.
HTML
<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 display property to turn the .flexbox elements into flex containers. We balance the items into three flex lines using flex-wrap and flex-line-count. We define a light blue rule to paint both row and column gaps, then overwrite the column-rule-color, setting darker blue column gap decorations. We also set the 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 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
Change the size of the inset. Note that in the right-hand example, where the column rule is a single segment that goes from top to bottom, the segment has two cap endpoints and no junction endpoints. Therefore, changing the column-rule-inset-junction-end value does not affect this example.
Specifications
| Specification |
|---|
| CSS Gaps Module Level 1> # propdef-column-rule-inset-junction-end> |
Browser compatibility
See also
column-rule-inset-junction-startcolumn-rule-inset-junctionshorthandrule-inset-junction-startshorthandcolumn-rule-insetshorthandrule-insetshorthandcolumn-rule-breakrule-breakshorthandrule-overlaprule-visibility-itemsruleshorthand- CSS gaps module