Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS dotted border renders as dashed in Chrome

I applied "border-bottom:#F60 dotted .3em;" to a div and while Firefox renders the dots as round, Chrome shows them as blocky dashes. Any takers?

like image 850
Commandrea Avatar asked Jan 26 '11 07:01

Commandrea


People also ask

Which CSS code snippet set the border to dotted line?

To set the dotted line for the border, use the border-style property.

How do you change the dashed border in CSS?

Native CSS properties don't support the customization of border-style . Therefore, we use a trick with an SVG image inside background-image property. The SVG features give us the ability to change the distance between dashed lines, set custom pattern, add dash offset or even change a line cap.

How do I change the space between dotted border dots?

The task is to increase space between the dotted border dots. you can just adjust the size with the background-size property, the proportion with the background-image property, and the proportion with the linear-gradient percentages. So, you can have several dotted borders using multiple backgrounds.


2 Answers

If it's important that the borders are the same you can look into the CSS3 border image property: http://www.css3.info/preview/border-image/ for Chrome it will be -webkit-border-image:

like image 69
Graham Conzett Avatar answered Sep 30 '22 17:09

Graham Conzett


The specification doesn't define what 'dotted' means to that level of detail. The two browsers just interpret it differently. This is not a problem.

like image 36
Quentin Avatar answered Sep 30 '22 17:09

Quentin