I build a ecommerce website and have multiple p tag that describe the product. I want that the product description will be align according to vertical line no matter the size of the word that precedes it. I want to know if this is possible to achieve this using perhaps flexbox or something like that but not table.
What I have now using gap and flexbox:
Code:
p
{
display:flex;
gap: 50px;
}
<p><span> Material:</span> <span > 18k Gold Plating</span></p>
<p><span> One:</span> <span > 18k Plating</span></p>
<p><span> Twotwo:</span> <span > 18k Yellow Plating</span></p>
<p><span> threethree:</span> <span > 18k Gold Plating</span></p>
<p><span> Four:</span> <span > 18k Gold</span></p>
What I want:


The easiest method, in browsers that don't support
grid-template-columns: subgridwould be to wrap the elements in a container – in the following code I used a<main>element – withdisplay: gridand with the<p>elements set todisplay: contents, which effectively pretends that the<p>elements aren't there, or are "invisible" to the DOM and layout:JS Fiddle demo.
References:
display.gap.grid-template-columns.inline-size.margin-block.margin-inline.