Web 15 Mark
Web 15 Mark
2 . Describe in detail the properties of a Flex container in CSS. Explain how each
property influences the layout of flex items within the container. Provide suitable
examples to demonstrate the behavior of these properties.
SSFlexbox,orFlexibleBoxLayout,isthelayoutmodeldesignedtocreateflexible
C
andresponsivelayoutstructureswithoutusingfloatorpositioning.Byapplyingdisplay:flex
to a parent container, it becomes a flex container, and its children becomeflexitems.This
allows control over the items’ growth, shrinkage, and space distribution.
Example
.flex-container
{
display: flex;
flex-direction: column;
}
Example
.flex-container
{
display: flex;
flex-wrap: wrap;
}
Example
.flex-container
{
display: flex;
flex-flow: row wrap;
}
Example
.flex-container
{
display: flex;
justify-content: center;
}
Example
.flex-container
{
display: flex;
align-items: center;
}
Example
.flex-container
{
display: flex;
height: 600px;
flex-wrap: wrap;
align-content: space-around;
}