HTML exercises

CSS Properties: How to make the flexible items wrap if necessary?

Go to Exercise page


HTML Code:

<!DOCTYPE html>
<title>How to make the flexible items wrap if necessary</title>
<style type="text/css">
#w3r {
  width: 150px;
  height: 200px;
  border: 1px solid #FF0099;
  display: -webkit-flex;
  -webkit-flex-wrap: wrap; 
  display: flex;
  flex-wrap: wrap;
#w3r div {
  width: 50px;
  height: 50px;
<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>

Live Demo:

See the Pen flex-wrap-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?

New Content: Composer: Dependency manager for PHP, R Programming

bedava porno