Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to make small circles via CSS?

Tags:

css

geometry

Rather than using images, I was wondering if anyone knows how to make small circles with outlines using CSS.

I'm trying to make something similar to the bullseye symbol or Target logo.

like image 634
Erik Avatar asked May 31 '11 13:05

Erik


People also ask

How do I make a circle around a circle in CSS?

To make a circle, use border-radius: 50% . Then just position 6 circular divs with absolute positioning around the larger circle.

How do I create a circle div in CSS?

Example of creating a circle with a text inside: Here, we set a percentage width and border-radius for the container. Then, we add an empty block of padding-bottom to the :after pseudo-element. Thus we can have the same result of creating a container with equal width and height.

How do I make an empty circle in CSS?

Creating an empty circle with CSS To create an empty circle first of all add an empty <div> element. Use CSS border-radius: 50% to make the div element circular. Additionally set the height, width and border of <div> element.


2 Answers

For anyone else who wants to draw a small circle, the following code makes use of scale to resize the circle. Just chamge the scale values and you're good to go!

.circle{
    border: 2px solid #1111a1;
    padding: 10px 40px; 
    background: #dddddd;
    width: 1px;
    height: 60px;
    border-radius: 100px;
    transform: scale(0.5, 0.5);
}

Plunkr

like image 116
Gabrielus Avatar answered Nov 14 '22 14:11

Gabrielus


You can use div's with rounded corners.

<style>
.circle{
    -webkit-border-radius:8px;
    -moz-border-radius:8px;
    border-radius:8px;
    border:1px solid #ccc;
    width:8px;
    height:8px;
}
</style>
<div class="circle"></div>

But, may be, it's better to use canvas and JavaScript.

like image 45
Alex Savin Avatar answered Nov 14 '22 12:11

Alex Savin