Height
Bootstrap 5 Height
Responsive Height built with Bootstrap 5. Examples of sizing, modal height, textarea height, line height & more.
Basic example
The red div
below is 100px height and all the child element are relative to it.
Height 100vh
But here red div
below is a representation of the client viewport and the pink one is a
representation of
the div
which has a height of 100vh. You can get 100% view height in the element by adding
to it
.vh-100
class.
Viewport
container with vh-100
Textarea height
If you want to change the default height of textarea just change rows
html attribute e.g.
rows="8"
in
textarea input element.
Line height
To change line
height in your paragraph you can add bootstrap class starting from .lh-*
then
combaine it with proper size e.g. lh-sm
.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis, aspernatur! Harum id, quibusdam commodi cum, rerum dolores accusamus dolorum, officiis eaque quas qui quidem placeat magnam quod incidunt! Tempora vero reprehenderit facere neque hic fugit iure, ea adipisci harum totam?
Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis, aspernatur! Harum id, quibusdam commodi cum, rerum dolores accusamus dolorum, officiis eaque quas qui quidem placeat magnam quod incidunt! Tempora vero reprehenderit facere neque hic fugit iure, ea adipisci harum totam?
Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis, aspernatur! Harum id, quibusdam commodi cum, rerum dolores accusamus dolorum, officiis eaque quas qui quidem placeat magnam quod incidunt! Tempora vero reprehenderit facere neque hic fugit iure, ea adipisci harum totam?
Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis, aspernatur! Harum id, quibusdam commodi cum, rerum dolores accusamus dolorum, officiis eaque quas qui quidem placeat magnam quod incidunt! Tempora vero reprehenderit facere neque hic fugit iure, ea adipisci harum totam?
Modal height
To change height of the modal add
.h-100
to the .modal-content
then just set
height of modal in .modal-dialog
e.g. .h-50
.