score:2
Accepted answer
use a pseudo-element positioned absolutely like so
div {
width: 50vw;
margin: auto;
position: relative;
padding-left: 10px;
}
div::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 6px;
height: 100%;
background: rebeccapurple;
border-radius: 3px
}
<div>
<p>lorem, ipsum dolor sit amet consectetur adipisicing elit. culpa sequi mollitia assumenda repudiandae impedit quidem, ducimus adipisci a ullam tenetur minus minima molestias provident recusandae non amet sapiente nihil ad, commodi ut optio veniam illo
qui! enim, neque odit? laboriosam quasi aperiam, molestiae culpa ipsum corrupti animi praesentium atque exercitationem.</p>
</div>
score:0
instead of using borders, have you tried using an svg line with its stroke-linecap
property set to round?
stroke-linecap: round;
https://css-tricks.com/almanac/properties/s/stroke-linecap/
edit: here is another approach if you want to stick to borders:
Source: stackoverflow.com
Related Query
- How to create a line with correct corner radius?
- How to mask line border with parent corner radius in CSS?
- How to create line chart with JSON data using D3
- How to create new line in react table column with lots of data
- How to create a css vertical line with circles and text on side in reactjs?
- How to create simple line chart with json response data
- How to use border radius only for 1 corner (react-native)?
- How to create a React Modal (which is appended to <body>) with transitions?
- How do I create a dynamic drop down list with react-bootstrap
- How to create forms with React and Rails?
- How to create MUI Dialog with transparent background color?
- How to create two columns with space beetwen in react native - flatList
- How to implement skipWaiting with Create React App?
- How to create dynamic routes with react-router-dom?
- How to create a package with the isolatedModules=true option enabled?
- How to create onSubmit with Material-UI
- How to create routes with params in gatsbyjs
- How to implement componentDidMount with hooks in React to be in line with the EsLint rule "react-hooks/exhaustive-deps": "warn"?
- How to create custom React Native components with child nodes
- How to create a generic React component with a typed context provider?
- How to Create Custom Dropdown Field Component with Redux-Form V6?
- How can I create a custom page with #react-admin without the menu sidebar like login page?
- How do you create multiple forms on the same page with redux-forms v6?
- How to create a controlled input with empty default in React 15
- How to create a link in a row with @material-ui/data-grid
- How to create sticky headers on scroll with react
- How can I create a search with multiple, optional, parameters using JavaScript?
- How to create a Micro Frontend bundle with Webpack that shares libraries with the container application?
- How to create a reusable react-hook-form component with TypeScript generics?
- How to read console.log from a mounted component with Enzyme and Jest in Create React App
More Query from same tag
- redux action type has optional payload property-typescript complains inside the reducer
- How can I mock the Geolocation API error function and !navigator.geolocation case in Jest?
- Webpack missing module error: Cannot find module "."
- Why do my props not work in grandchild component?
- How to fit map to full screen?
- Show bootstrap modal with custom title using React JS
- Updating data on changedropdown in Reactjs gets delayed
- Facebook React: Invariant Violation and elements than didn't mount automatically
- Ant Design Components - Inside function of antd components "this" is undefined
- Why I cant call useRouter hook inside getServerSideProps in next.js
- Send cursor to the end of input value in React
- Accessing JavaScript Object property dynamically during useState update
- Django Rest Framework + React rest hooks CORS error
- React - How to pass value to filter function in component?
- Passing fetch function to child component
- How to download file without opening in new tab in reactjs
- Can not have more then 7 numbers in Pie Chart from Apex Charts
- Cannot load local files in electron js
- Calculating total not returning anything React
- Form submission using react without having state
- Reactjs not updating the State in functional component
- Reroute to component passing response data
- React Typescript error Type '{ id: number; title: string; function(): void; }' is not assignable to type 'null'
- Add photo in object and show it
- Hello, I am using antd treeselect in my react js project . and when i am clicking on parent node child options are not appearing
- react-redux connect with Formik - Maximum call stack size exceeded
- How to toggle a button in React list?
- Display Multiple Markers with Google Maps and React Js ES6
- Change default Text Color Material UI
- How can I run the code even when API fails