score:3
try using nested box-shadows:
.circle-border-2 {
border-radius: 50%;
width: 200px;
height: 200px;
margin: 10px;
background-color: #ccdde5;
box-shadow: 0 0 0 5px white,
0 0 0 10px #ccdde5;
}
<div class="circle-border-2"></div>
this approach even allows you to add multible borders:
.circle-unicorn {
border-radius: 50%;
width: 200px;
height: 200px;
margin: 50px;
background-color: white;
box-shadow: 0 0 0 5px #9932ff,
0 0 0 10px #b231fd,
0 0 0 15px #ff31eb,
0 0 0 20px #ff3291,
0 0 0 25px #fe3030,
0 0 0 30px #fe6031,
0 0 0 35px #ffc132,
0 0 0 40px #30fe5b,
0 0 0 45px #5230ff,
0 0 0 50px #3e25bf;
}
<div class="circle-unicorn"></div>
score:1
you can do this very easily, by simply adding an background color, padding and solid border.
i created a quick example: https://jsfiddle.net/o81rre69/
.upload {
border-radius: 50%;
padding: 5px;
height: 150px;
width: 150px;
background: #fff;
border: 3px solid #bbb;
}
hope it helps!
score:2
handtrix's answer is a good one. another possible solution:
.circle-shadow-border {
border-radius: 50%;
width: 200px;
height: 200px;
background-color: gray;
box-shadow: 0px 0px 0px 5px white inset;
border: solid 5px gray;
margin: 20px;
}
<div class="circle-shadow-border"></div>
or use background-clip: content-box;
:
.circle-border-backclip {
border-radius: 50%;
width: 200px;
height: 200px;
background-color: gray;
margin: 20px;
border: solid 5px gray;
padding: 5px;
background-clip: content-box; /* support: ie9+ */
}
<div class="circle-border-backclip"></div>
for more information you could see https://css-tricks.com/snippets/css/multiple-borders/.
Source: stackoverflow.com
Related Query
- How to create a double outline border?
- How to create text border in React Native?
- How do I create a diagonal border in React Native?
- When given a sentence, how to create a border for every single word including whitespace through iteration in react?
- How can I create a Double Click Link in react?
- How to create a curved border in the corner of a div?
- How to create helper file full of functions in react native?
- How to create a React app directly in the current folder
- How to create unique keys for React elements?
- How to create dynamic href in react render function?
- How is ESLint integrated into Create React App?
- How to use border radius only for 1 corner (react-native)?
- How to change the border color of MUI TextField
- How to create multiple page app using react
- How to create a React Modal (which is appended to <body>) with transitions?
- How do I create configuration for axios for default request headers in every http call?
- How to create a dynamic prop name in React?
- How do you create optgroups in react-select v2?
- How can I put border styling with react-stripe-elements input component?
- How do I create a dynamic drop down list with react-bootstrap
- How to create forms with React and Rails?
- How to generate sourcemaps in create react app?
- How to create MUI Dialog with transparent background color?
- How to create dynamic route in gatsby
- How do I create a TypeScript type definition for a stateless React component?
- How to create and run a development build of an application using create-react-app configuration
- React-Native - How to create a disabled style for the TouchableOpacity component?
- How to create two columns with space beetwen in react native - flatList
- How to not show warnings in Create React App
- how to create common helper class in React JS using ES6 which is used by another component?
More Query from same tag
- Is there a way to change the state in redux outside the component tree inside another file?
- Creating a booking system, but I struggle with inserting the input date to MySQL table
- how to do this in new version(React.CreateElement)
- React, undefined this
- How to add a Material UI Tooltip on a Material UI Datagrid headername?
- Using forEach on a nested object key react javascript
- Update a "UseContext array" fail to re-render/generate a new component
- Issue with MUI 5 datePikker when we add inputFormat
- Start a setTimeout in componentDidMount and end it in componentWillUnmount in React
- I need Regex to mask email address in javascript
- error: bundling failed: ReferenceError: SHA-1 for file index.js
- How to prevent double rerender when I use props, useState and useEffect?
- React only re-rendering one setState but not the other
- I am trying to delete items from TODO app using axios and django
- How can I convert class component into functional component when adding React library to a Website?
- How to read DraftJS state from localStorage?
- when i run "npm run dist_win", get a error: "node_modules" Not an internal or external command?
- Event listener for multiple keys in React?
- ReactJs can't get async content form api call in useEffect and use it later in component
- How can I add compoent to another component in React?
- is it possible for a cookie to be deleted by itself?
- importing sass file returns empty object or global stylesheet is ignored
- react-router (v4) how to go back?
- React Pass associated data (props) to descendents
- How to create array list from for loop in react
- Trying to deploy my REACT Webpack app to heroku. Everything works locally and the heroku build works. But I'm getting a 404 nginx
- How to optimize update of object array in useReducer?
- Reactjs - Isotope - expand and collapse on click - but have ONLY one item at a time
- display an array with the largest number of votes
- Execute an "or statement" in return in reactJS