Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Daniel Campbell
10,148 PointsFlexbox flex-wrap not working on mobile size screens
Hello,
Here is the site http://cepetitmonde.com/
Here is the code
.container {
min-height: 100vh;
display: flex;
flex-wrap: wrap;
overflow: none;
flex-direction: row;
}
.col1, .col2, .col3 {
display: flex;
flex-wrap: wrap;
flex-direction: column;
}
.col1, .col3 {
padding: 1%;
}
.col2 {
justify-content: space-between;
align-items: center;
}
/* centers .col2 on larger screens */
@media (max-width: 800px) {
.col3 {
display: none;
}
}
and HTML
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ce Petit Monde</title>
<link href="https://necolas.github.io/normalize.css/latest/normalize.css rel="stylesheet" type="text/css" />
<link href="css/base.css" rel="stylesheet" type="text/css" />
<link rel="icon" type="image/png" href="img/logo-icon.png">
</head>
<body>
<div class="container">
<div class="col1">
Nouveau site bientôt!<p>
<img src="img/glyph-logo_May2016.png" width="20" height="20"> <a href="https://www.instagram.com/ce_petit_monde/" target="_blank">ce_petit_monde</a><br>
<a href="mailto:info@ceptitmonde.com">info@cepetitmonde.com</a><br>
06 60 46 72 92 <br>
</div>
<div class="col2">
<img src="img/logo.png" width="89" height="166">
<img src="img/scenery.png" alt="" width="390" height="390">
</div>
<div class="col3">
</div>
</div>
<div id="credit">
<div class="small-text">
Site by <a href="http://visuel.org">Visuel.org</a>
</div>
</div>
</body>
</html>
On mobile screens the flex columns (.col1, .col2) are side by side and not wrapping.
So flex-wrap isn't working on mobile browsers, but it works in Chrome Devtools when testing mobile sized screens.
Thank you, Daniel
1 Answer
Iain Simmons
Treehouse Moderator 32,305 PointsWorks on my Android phone, which is probably some version of Chromium. Might be a browser specific issue. What are you using?
Some mobile browsers and operating systems give you a way to connect to the dev tools on your computer. Might help with debugging.