w3resource
HTML exercises

CSS Properties: How to set the direction of the flexible items inside the division element in reverse order?

Go to Exercise page

Solution:

HTML Code:

<!DOCTYPE html>
<html>
<head>
<title>How to set the direction of the flexible items inside the division element in reverse order</title>
<style type="text/css">
#w3r {
  width: 400px;
  height: 400px;
  border: 1px solid #c3c3c3;
  display: -webkit-flex;
  -webkit-flex-direction: row-reverse;
  display: flex;
  flex-direction: row-reverse;
}
#w3r div {
  width: 60px;
  height: 60px;
}
</style>
</head>
<body>
<p><strong>w3resource Tutorial</strong></p>
<div id="w3r">
<div style="background-color:#00FF00;">HTML5</div>
<div style="background-color:#3333FF;">CSS</div>
<div style="background-color:#FF6600;">PHP</div>
<div style="background-color:#FF3399;">SQL</div>
<div style="background-color:#FFCC33;">MYSQL</div>
</body>
</html>

Live Demo:

See the Pen flex-direction-answer by w3resource (@w3resource) on CodePen.


See the solution in the browser

Supported browser

Firefox logo Chrome logo Opera logo Safari logo Internet Explorer logo
Yes Yes Yes Yes No

Go to Exercise page

What is the difficulty level of this exercise?