Suppose you have an HTML Paragraph Element (e.g., <p>
) with certain text sections highlighted using a HTML Mark Element (e.g., <mark>
). I am interested in adding a vertical line in the margin or gutter (uncertain about the appropriate term) that aligns with the position and height of the <mark>
.
I created a JSFiddle to demonstrate the issue. The green vertical lines are currently displaying at the correct height but are not positioned correctly. My goal is to have them aligned all the way to the left, following the border of the p
tag.
The HTML markup can be adjusted as needed. I prefer achieving this effect using only CSS, without relying on JavaScript. However, if it proves impossible through CSS alone, I am capable of implementing it using JavaScript.