basic flex and mainpulation css hide and show

Solution retrospective
I still don't know the best practice convert from web to mobile, especially breakdown div from this case
in web view
<div class='containerFlex'>
<div class='containerA leftSide'>
<div class='title'></div>
<div class='article'></div>
</div>
<div class='containerB rightSide'>
<div class='photo'></div>
</div>
</div>
in mobile view
<div class='container viewFromTopToDown'>
<div class='title'></div>
<div class='photo'></div> /*see photo are in mid!!! */
<div class='article'></div>
</div>
/* ------------------------------------- */ so my solution are:
<div class='containerFlex'>
<div class='containerA'>
<div class='title'></div>
<div class='photo mobileMode'></div>
<div class='article'></div>
</div>
<div class='containerB'>
<div class='photo webMode'></div>
</div>
</div>
/* ------------------------------------- */ so the css are:
.mobileMode{
display:none;
}
.webeMode{
display:block;
}
@media {
.webMode{
display:none;
}
.mobileeMode{
display:block;
}
}
/* ------------------------------------- */ but again, I don't think thats the right answer since I'm newbie and none of my friend are web programer
Please log in to post a comment
Log in with GitHubCommunity feedback
- @NationsAnarchy
Hey there Udin, good job showing your solution here on the website!
If you want to have a different layout for a smaller width, you can use the CSS media query properties: https://www.w3schools.com/css/css_rwd_mediaqueries.asp
Please have a look at that article, it should give you the idea on how to align/size elements properly with different screen widths. Do let us know what else we can help you with as well, and happy coding!
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord