How to set a border for an HTML div tag with CSS?

Spread the love

Sometimes, we want to set a border for an HTML div tag with CSS.

In this article, we’ll look at how to set a border for an HTML div tag with CSS.

How to set a border for an HTML div tag with CSS?

To set a border for an HTML div tag with CSS, we set the border property.

For instance, we write

div {
  border: 1px solid black;
}

to set border to 1px solid black to make the div’s border 1px thick, have solid line style, and is black.

Conclusion

To set a border for an HTML div tag with CSS, we set the border property.

Leave a Reply

Your email address will not be published.