Contact Us | +1 888 239-0733 (Toll free US/CA) Mon-Fri: 7:30am to 4:30pm (PST)

CSS 'border-bottom' Property Explained

Est. Reading: 1 minute
Posted: April 3, 2024

The CSS 'border-bottom' property is a shorthand for setting the width, style, and color of an element's bottom border at once. This property streamlines the process of defining how an element's bottom border should appear, combining three aspects of border styling into a single declaration.

CSS 'border-bottom' Property Examples

See the Pen CSS 'border-bottom' Property by Webzstore (@webzstore) on CodePen.

The 'border-bottom' property offers a concise way to customize the appearance of an element's bottom border, enhancing the design flexibility and visual appeal of web pages.

Browser Support For 'border-bottom' Property

FirefoxSafariChromeMicrosoft EdgeOpera
1.01.01.04.03.5

CSS Syntax of the 'border-bottom' Property

border-bottom: width style color | initial | inherit;

Usage of the 'border-bottom' Property

Use 'border-bottom' to apply specific styling to the bottom border of an element. This is particularly useful for visually distinguishing an element within a layout, such as underlining a heading for emphasis or denoting a boundary within a component. The shorthand property simplifies the code and enhances readability by consolidating border width, style, and color settings.

Property Values of the 'border-bottom' Property

  • Width: Specifies the thickness of the border. Acceptable values include length units (e.g., px, em) and predefined thickness keywords (thin, medium, thick).
  • Style: This determines the border's line style (none, solid, dotted, dashed, double, groove, ridge, inset, outset).
  • Color: This sets the border's color. It can be defined using named colors, HEX codes, RGB(a), and HSL(a) values.
  • Initial: Resets the 'border-bottom' to its default value, removing any custom styling applied to the bottom border.
  • Inherit: Inherits the 'border-bottom' property from the element's parent, allowing for consistent border styling within nested elements.

Ryan Parker

Ryan has been a standout in digital marketing since 2010. He's the go-to person for getting businesses noticed online, with over 300 projects under his belt—these range from helping local business owners to big online stores. As the Head of Digital Marketing at Webzstore Solutions, Ryan knows all the tricks to make companies shine on the internet. He's excellent at using the latest tech and smart strategies to get results. Ryan is all about making businesses grow and reach more people online.

chevron-down