html - What is the easiest way to draw a rounded line next to a paragraph? -


i want have vertical line next text. can use 'border-left' draw vertical line on left, didn't find out yet how round it's corners. following image shows how should about:

enter image description here

use absolutely positioned pseudo-element achieve same purpose. in example below, using ::before absolutely positioned , set full height of parent (using top: 0; bottom: 0; trick). can set width , use border-radius half width achieve rounded corners.

p {    position: relative; /* required pseudo-element positioned correctly */    padding-left: 30px; /* dummy value make space pseudo-element */  }    p::before {    /* create pseudo-element , give content */    content: '';    display: block;        /* position in parent is:     * - left     * - occupies full height     */    position: absolute;    top: 0;    left: 0;    bottom: 0;        /* give fixed width , rounded corners */    width: 10px;    border-radius: 5px;        /* appearance */    background-color: steelblue;  }
<p>lorem ipsum dolor sit amet, consectetur adipiscing elit. duis sollicitudin metus tincidunt felis maximus, maximus sollicitudin mi ultrices. curabitur libero arcu, bibendum ac suscipit ut, elementum scelerisque lacus. praesent ultricies commodo porttitor. fusce eget velit nisi. praesent vulputate venenatis dui, efficitur sollicitudin nisi pulvinar a.</p>


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -