user782104 user782104 - 3 months ago 10
CSS Question

How can I set a css border on one side only?

For a given

div
I would like to only display a border on the left, right, top, or bottom side.

Currently I have the following, which puts a border on all sides:

#testdiv {
border: 1px solid;
}


What do I need to do in order to have a border only on the left side?

Answer
#testdiv {
   border-left: 1px solid;
}

See the MDN documentation on border.