Which of the following property defines the visual style of up to four different sides of a border?

border-width
border-top
border
border-style

The correct answer is D. border-style.

The border-style property defines the visual style of up to four different sides of a border. It can be used to specify the border width, color, and style of each side of the element.

The border-style property takes a list of four values, one for each side of the element. The values can be any of the following:

  • solid: A solid border.
  • dashed: A dashed border.
  • dotted: A dotted border.
  • double: A double border.
  • groove: A groove border.
  • ridge: A ridge border.
  • inset: An inset border.
  • outset: An outset border.
  • none: No border.

The border-style property can also be used to specify the border width for each side of the element. The width is specified in pixels.

For example, the following CSS code will create a box with a solid black border that is 1px wide on all sides:

border-style: solid black 1px;

The following CSS code will create a box with a dashed red border that is 2px wide on the top and bottom, and a solid black border that is 1px wide on the left and right:

border-style: dashed red 2px solid black 1px;