CodePen
codepen.io › fudime › pen › wjeRrq
CSS Circles with Border Radius
Minimize CSS Editor · Fold All ... 0 0 40px 0; font-size: 25px; line-height: 30px; } .circle { width: 200px; height: 200px; line-height: 200px; border-radius: 50%; /* the magic */ -moz-border-radius: 50%; -webkit-border-radius: ...
CodePen
codepen.io › colinlord › pen › PdZMGz
Spinning Border Circle with CSS Transforms
Minimize CSS Editor · Fold All · Unfold All · body { background: $white; padding: 20px 0; } .outer-circle { background-image: linear-gradient($red, $red-lightest, $near-white); width: 305px; height: 305px; border-style: solid; border-color: transparent; border-radius: 50%; border-width: 0; animation: rotateCircle 2s linear infinite; padding: 2px; display: table; .inner-circle { background: $white; height: 305px; width: 305px; border-style: solid; border-color: transparent; border-radius: 50%; border-width: 1px; animation: rotateCircle 2s linear infinite reverse; display: table; text-align:
Videos
10:30
Ten Ways to create a Circle using CSS | CSS Tips | CSS3 - YouTube
03:07
Make a Circle Inside a Circle in HTML & CSS - YouTube
01:38
How to Create Circle in HTML and CSS - YouTube
02:43
How to Create Rounded or Circular Image | HTML and CSS Tutorial ...
05:50
How to create a circle using HTML & CSS? - YouTube
06:07
CSS Border Radius Property, Make Circle, Rounded Borders & much ...
freeCodeCamp
forum.freecodecamp.org › t › css-border-on-circle-within-circle › 115428
CSS border on circle within circle - The freeCodeCamp Forum
May 14, 2017 - Take a look at this codepen to see the problem I’m having. https://codepen.io/jaldhar/pen/JNvwBE If you did the simon challenge how did you approach creating the look and feel? (Just describe your approach please. I don’t want to cut and paste any code. That’s why I haven’t looked at ...
CodePen
codepen.io › kirstyburgoine › pen › xaqGQm
CSS Border - Simple Two Tone Circle
In CodePen, whatever you write in the HTML editor is what goes within the <body> tags in a basic HTML5 template. If you need things in the <head> of the document, put that code here. ... The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https. ↑ Insert the most common viewport meta tag · CSS ...
CodePen
codepen.io › katmai7 › pen › npRRQP
Border animation (circle)
Minimize CSS Editor · Fold All · Unfold All · html{ height: 100%; } body{ height: 100%; background: #E94E3D; } .wrap{ margin: 100px auto; width: 130px; } @color: #E94E3D; .circle{ position: relative; overflow: hidden; width: 120px; height: 120px; border-radius: 50%; background: #E94E3D; box-shadow: 60px -60px 0 2px @color, -60px -60px 0 2px @color, -60px 60px 0 2px @color, 60px 60px 0 2px @color, 0 0 0 2px #E94E3D; .icon{ position: absolute; display: block; color: #fff; font-size: 20px; } .i1{ top: -25px; left: 55px; } .i2{ top: 50px; left: -20px; } .i3{ bottom: -25px; left: 50px; } .i4{ to
CodePen
codepen.io › nordstromdesign › pen › QNrBRM
Responsive Circle with Border Gradient
Minimize CSS Editor · Fold All · Unfold All · // Variables $primary-gradient-color-1: rgba(242,189,242,1); $secondary-gradient-color-2: rgba(140,218,237,1); // $gradient-color-1: rgba(120,223,242,1); // $gradient-color-2: rgba(140,119,176,1); body { background-color: white; } .container { width: 90%; max-width: 500px; margin: 0 auto; padding: 20px; } .circle { position: relative; width: 100%; padding-top: 100%; border-radius: 50%; background-color: white; &:before { position: absolute; content: ""; width: 104%; height: 104%; top: -2%; left: -2%; background-color: white; border-radius: 50%;
CodePen
codepen.io › hubspot › pen › BaWrLbv
How to Make a Perfect Circle With a Border Radius in CSS
In CodePen, whatever you write in the HTML editor is what goes within the <body> tags in a basic HTML5 template. If you need things in the <head> of the document, put that code here. ... The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https. ↑ Insert the most common viewport meta tag · CSS ...
CodePen
codepen.io › ilPas › pen › jYeEyV
Circle gradient border only CSS
Minimize CSS Editor · Fold All · Unfold All · body { background-color: #ddd; text-align: center; } .rounded-gradient-borders { width: 250px; height: 250px; border: double 10px transparent; border-radius: 50%; background-image: linear-gradient(white, white), radial-gradient(circle at top left, #f00,#3020ff); background-origin: border-box; background-clip: content-box, border-box; display: inline-block; box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23); } .rounded-corners-gradient-borders-2 { border: double 10px black; width: 300px; height: 300px; border-radius: 50%; background-clip: content-box; background-color: red; float: left; } !
CodePen
codepen.io › abdelrahmanahmed › pen › XXdONp
animated border (circle)
Minimize CSS Editor · Fold All · Unfold All · .container { padding: 100px; } .image-circle { width: 132px; height: 132px; border-radius: 50%; border-top: 2px dashed #ffcc00; border-right: 2px dashed #ffcc00; border-left: 2px dashed #000000; border-bottom: 2px dashed #000000; padding: 10px; animation: spin 10s infinite linear; } .image-circle img { animation: spin 10s infinite reverse linear; width: 100%; border-radius: 50%; } @keyframes spin { 100% { transform: rotate(1turn); } } !
Top answer 1 of 5
82
You forgot to set the width of the border! Change border: red; to border:1px solid red;
Here the full code to get the circle:
.circle {
background-color:#fff;
border:1px solid red;
height:100px;
border-radius:50%;
-moz-border-radius:50%;
-webkit-border-radius:50%;
width:100px;
}
<div class="circle"></div>
2 of 5
40
You are missing the border width and the border style properties in the Border shorthand property :
.circle {
border: 2px solid red;
background-color: #FFFFFF;
height: 100px;
border-radius:50%;
width: 100px;
}
<div class="circle"></div>
Also, You can use percentages for the border-radius property so that the value isn't dependent of the circle width/height. That is why I used 50% for border-radius (more info on border-radius in pixels and percent).
Side note : In your example, you didn't specify the border-radius property without vendor prefixes, you propably don't need them as only browsers before chrome 4 safari 4 and Firefox 3.6 use them (see canIuse).
CodePen
codepen.io › elingbeek › pen › GomOXd
Counter Circle Border
In CodePen, whatever you write in the HTML editor is what goes within the <body> tags in a basic HTML5 template. If you need things in the <head> of the document, put that code here. ... The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https. ↑ Insert the most common viewport meta tag · CSS ...
CodePen
codepen.io › BoskoMali › pen › BKvJrb
Half Circle With CSS
Minimize CSS Editor · Fold All · Unfold All · $width: 580px; $height: 290px; @mixin half-circle ($direction: right) { @if $direction == right { border-radius: 0 100% 100% 0 / 0 50% 50% 0; } @elseif $direction == left { border-radius: 100% 0 0 100% / 50% 0 0 50%; } @elseif $direction == top { border-radius: 50% 50% 0 0 / 100% 100% 0 0; } @elseif $direction == bottom { border-radius: 0 0 50% 50% / 0 0 100% 100%; } @else { @error 'Please set correct $direction value.'
W3Schools
w3schools.com › howto › howto_css_circles.asp
How To Create Circles / Round Dots
<span class="dot"></span> <span class="dot"></span> <span class="dot"></span> <span class="dot"></span> To create a circle, use the border-radius property and set the value to 50%. Then combine the height and width properties with a matching value: