Use of AlignmentAlignment refers to lining up elements along an axis. There are two basic ways to do this: align elements along…