Is there a way to set the border-color in CSS to be the same as the text color?
For instance having a class which adds a bottom dotted border, but leaving the color of said border to match the color of the text in much the same way as the color of text-decoration:underline is the color of the text (color property)?
You actually get this behavior for free; it’s mentioned in the spec:
So all you have to do is omit the color when using the
bordershorthand property:Or only use the
border-styleandborder-widthproperties, and notborder-color:Or, in browsers that support the new CSS3 keyword
currentColor, specify that as the value forborder-color(useful for overriding existingborder-colordeclarations):The color that the border takes on will be the same as the text color by default.