flexbox rows code example

Example 1: flex css end

.item {
  align-self:flex-start | flex-end | center | baseline | stretch;
}

Example 2: use flex in container with multiple components

.wrap {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;         /* NEW */
  height: 100px;                  /* NEW */
  justify-content: space-between; /* NEW */
}
.elem1 {
  width: 20%;
  flex-basis: 100%;               /* NEW */
  border: 1px solid red;
}
.elem2,
.elem3 {
  width: 75%;
  flex-basis: 40%;                /* NEW */
  border: 1px solid red;
}

Example 3: flex box in css

<!--basic--flex--layout-->
<html>
	<head>
		<style>
			.parent{
              display:  flex or inline-flex;
              flex-direction: row  or column;
              flex-wrap: wrap or wrap-reverse;
 			}
		</style>
	</head>
	<body>
		<div class="parent">
			<div class="child-1"></div>
			.
			.
			.
		</div>
	</body>
</html>

Example 4: flex box css

.container {
  flex-direction: row | row-reverse | column | column-reverse;
}

Example 5: flex row

.item {
  order: 5; /* default is 0 */
}

Tags:

Css Example