What is flex-direction?

The flex-direction property in CSS is used within a flex container to define the direction in which flex items are laid out. It establishes the main axis along which items are placed and determines the direction of the main axis and cross axis.

<div class="flaxbox">
   <div class="item">
      <span class="clr-1">Travel Agency in India</span>
      <h1>50%<small>/OFF</small></h1>
      <p>www.orioleholiday.com</p>
   </div>
   <div class="item">
      <span class="clr-1">Travel Agency in India</span>
      <h1>60%<small>/OFF</small></h1>
      <p>www.orioleholiday.com</p>
   </div>
   <div class="item">
      <span class="clr-1">Travel Agency in India</span>
      <h1>70%<small>/OFF</small></h1>
      <p>www.orioleholiday.com</p>
   </div>
   <div class="item">
      <span class="clr-1">Travel Agency in India</span>
      <h1>80%<small>/OFF</small></h1>
      <p>www.orioleholiday.com</p>
   </div>
</div>

flex-direction: row-reverse

.flaxbox {
display: flex;
padding: 10px;
gap: 10px; /* Space between items */
flex-direction: row-reverse;
}
.flaxbox .item {
border:1px solid #4CAF50;
color: black;
padding: 20px;
text-align: center;
flex: 1; /* Items will grow to fill the container */
}

flex-direction: column-reverse

.flaxbox {
display: flex;
padding: 10px;
gap: 10px; /* Space between items */
flex-direction: column-reverse;
}
.flaxbox .item {
border:1px solid #4CAF50;
color: black;

administrator

Leave a Reply

Your email address will not be published. Required fields are marked *