Saltar al contenido

Propiedad CSS border-bottom-width

La propiedad border-bottom-width establece el ancho del borde inferior.

Para ver el efecto de border-bottom-width, también debes establecer una propiedad border-style o border-bottom-style. Sin un estilo de borde, el ancho no tiene efecto visible.

La especificación no define el grosor exacto para cada palabra clave; el resultado preciso depende de la implementación. Sin embargo, siempre siguen el patrón thin ≤ medium ≤ thick, y los valores permanecen constantes dentro de un mismo documento.

Initial Valuemedium
Applies toAll elements. It also applies to ::first-letter.
InheritedNo.
AnimatableYes. The width can be animated.
VersionCSS1
DOM Syntaxobject.style.borderBottomWidth = "5px";

Sintaxis

Sintaxis de la propiedad CSS border-bottom-width

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

Ejemplo de la propiedad border-bottom-width:

Ejemplo de la propiedad CSS border-bottom-width con el valor thick

html
<!DOCTYPE html>
<html>
  <head>
    <style>
      p {
        border-style: dotted;
        border-bottom-width: thick;
      }
    </style>
  </head>
  <body>
    <p>
      As you can see, we used border-bottom-width property to set the width of bottom border of this element.
    </p>
  </body>
</html>

Resultado

CSS border-bottom-width Property

Ejemplo de la propiedad border-bottom-width con el valor "medium":

Ejemplo de la propiedad CSS border-bottom-width con el valor medium

html
<!DOCTYPE html>
<html>
  <head>
    <title>The title of the document</title>
    <style>
      h2 {
        border-bottom-style: groove;
        border-bottom-width: medium;
      }
      div {
        border-style: groove;
        border-bottom-width: medium;
      }
    </style>
  </head>
  <body>
    <h2>A heading with a medium bottom border.</h2>
    <div>A div element with a medium bottom border.</div>
  </body>
</html>

Ejemplo de la propiedad border-bottom-width que muestra la diferencia entre los valores "thin" y "thick":

Ejemplo de la propiedad CSS border-bottom-width con el valor thin

html
<!DOCTYPE html>
<html>
  <head>
    <title>The title of the document</title>
    <style>
      h2 {
        padding: 5px;
        border-bottom-style: ridge;
        border-bottom-width: thin;
        border-color: #cccccc;
      }
      div {
        padding: 5px;
        border-style: ridge;
        border-bottom-width: thick;
      }
    </style>
  </head>
  <body>
    <h2>A heading with thin bottom border</h2>
    <div>A div element with thick bottom border.</div>
  </body>
</html>

Valores

ValueDescriptionPlay it
mediumEstablece un borde inferior medio. Es el valor predeterminado.Play it »
thinEstablece un borde inferior fino.Play it »
thickEstablece un borde inferior grueso.Play it »
lengthEstablece el ancho del borde inferior en un valor de longitud específico.Play it »
initialEstablece la propiedad en su valor predeterminado.Play it »
inheritHereda el valor de la propiedad del elemento padre.

Práctica

Which of the following values are accepted by the border-bottom-width property in CSS?

¿Te resulta útil?

Vista previa dual-run — compárala con las rutas Symfony en producción.