Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

css
community creator
border
width

What is the CSS border-top-width property?

Behzad Ahmad

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The border-top-width property in CSSCascade Style Sheets sets the element’s width of the top border.

We should declare the border-style and border-top-style property before using the border-top-width property because the width is only changed when the element has some border.

Syntax


border-top-width: medium|thin|thick|length|initial|inherit;

Property values

  • thin: It is used to specify that the top border is thin.

  • thick: It is used to specify that the top border is thick.

  • length: It is used to define the thickness of the top border.

  • medium: It is the default value and is used to specify that the top border is medium.

  • initial: It is used to set the value to its default value.

  • inherit: It is used to inherit property from its parent value.

Code

The following is the basic HTMLHyperText Markup Language and CSS code to demonstrate the use of the border-top-width property.

RELATED TAGS

css
community creator
border
width

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring