How to use the Bootstrap 4 flex
Overview
flex helps us manage the layout, alignment, and size of the columns, navbar, and components making the components very responsive on a website. It removes the stress of using positions or floats and still keeps the site layout structure seamlessly responsive.
Explanation
-
Line 23: We have a
divelement with theclassattribute ofd-flex. This class applies flex styling to thedivelement and every other element it wraps. Other values in the class attribute of thedivadd styling to the flex but are not determinants for the Bootstrap flex. -
Line 24 to 26: These are the contents of the
d-flexclassattribute. They add optional styling like colors. -
Line 27: We close the
divwith thed-flexclass attribute.