I am looking to create labels that designate specific groups of words. Here are the criteria:
- The label should appear to the left of the word group
- The words should be enclosed in lines, while the label should not
- The words should be indented, while the label should not
Currently, I'm facing an issue where the formatting is incorrect. The left boundary and indentation are being applied to the text created by ::before. How can I resolve this problem?
div[role=s]::before {
content: "s ";
}
div {
border-left: 1px inset lightgrey;
border-top: 1px inset lightgrey;
border-bottom: 1px inset lightgrey;
padding-left: 1em;
}
<div role="s">
Peter and John
</div>