Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

css

What is border-collapse property in CSS?

Hassaan Waqar

The `border-collapse property is used to set the collapsing border models of a table.

Syntax

The syntax of the border-collapse property is as follows:

border-collapse: separate|collapse|initial|inherit;

Possible values

The `border-collapse property can take the following values:

  • Separate: This is the default value. Borders are separate. Each cell will have its own border
  • Collapse: Borders are combined into a single border for all cells (where possible)
  • Initial: Sets border spacing to the default value
  • Inherit: Inherits border-spacing from its parent element

Example

The snippet below shows the difference between separate and collapse border models in CSS:

  • HTML
  • CSS

RELATED TAGS

css

CONTRIBUTOR

Hassaan Waqar
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring