Languages

CSS - what is default flex-direction?

0 points
Asked by:
Rogan-Wilkes
727

Can you tell me what is default flex-direction property value?

I can't check like this:

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
  <head>
    <style>

      .my-element {
          display: flex;
      }

    </style>
  </head>
<body>
  <div id="my-element">My element</div>
</body>
<script>
  
  var myElement = document.querySelector('#my-element');

  console.log(myElement.style.flexDirection);

</script>
</html>
1 answer
0 points
Answered by:
Rogan-Wilkes
727

The default value of the CSS flex-direction property is row.

.my-element {
    display: flex;
    flex-direction: row; /* default */
}

 

References

  1. flex-direction - CSS: Cascading Style Sheets | MDN
0 comments Add comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join