Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Circle with dotted or dashed border [closed]

Tags:

html

css

With this CSS styles I expect a circle with dotted border:

div{
    border: 1px dotted #000;
    padding: 50px;
    border-radius: 100px;
    display: inline-block;
}

But Firefox is rendering solid borders (fiddle here). Any solution?

UPDATE
THIS IS NOT AN ISSUE ANY MORE.
RESOLVED in Firefox 50

like image 468
Omid Avatar asked Oct 10 '13 22:10

Omid


People also ask

What is Border Style dashed?

dashed: A series of square dashed lines are used as a border. double: Two lines placed parallel to each other act as the border. groove: Displays a 3D grooved border, its effect depends on border-color value. ridge: Displays a 3D ridged border, its effect depends on border-color value.

Which CSS property is used for an image border with dotted red?

The border-style property specifies what kind of border to display. The following values are allowed: dotted - Defines a dotted border.

How do you put a space between dotted borders?

IF you're only targeting modern browsers, AND you can have your border on a separate element from your content, then you can use the CSS scale transform to get a larger dot or dash: border: 1px dashed black; border-radius: 10px; -webkit-transform: scale(8); transform: scale(8);


1 Answers

If you're using Firefox, this is a known bug. Your options are:

  • If this is just for the sake of a circle, draw it with <canvas>, e.g. as demonstrated here
  • Use SVG (possibly inline), which supports various ways to stroke paths
  • Just make a PNG
  • Fix the bug, which Mozilla will surely appreciate ;)
like image 157
Eevee Avatar answered Oct 13 '22 11:10

Eevee