I added a CSS border. Why isn’t it showing?

When tutoring, I run into this issue all the time.

“I have a color and a width for my border. Why isn’t it showing up?”

You must specify border-style. (You probably want it to be solid).

Believe it or not, the default value for border-style is none. So if you haven’t specified a style, you have no border at all!

Values other than solid you can use for border-style:

dotted

dashed

double (Border width must be 3px or greater)

groove (Width at least 2px)

ridge (Width at least 2px)

inset (Width at least 2px)

outset (Width at least 2px)

There are no comments on this post

Leave a Reply