I am new to programming. I wrote code that looks fine on desktop but not on mobile.Does anyone have any sugesstions?
<style>
body{
margin: 0;
}
.container {
width: 100vw;
height: 100vh;
font-family: 'Quicksand',sans-serif;
font-weight: bold;
font-size: 20px;
display: grid;
grid-template-columns: repeat(4, 1fr);
box-sizing: border-box;
}
</style>
</head>
<body>
<div class="container">
<div class="content-large"><img src="images/tribe-wanderer.png" style="margin-left: 390px; width: 35px; margin-top: 150px;"></div>
<div>
<div class="content-large" style="font-size: 40px; margin-top: 150px;">Wanderer</div>
<p style="font-size: 12px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Ut enim ad minim veniam,<br> quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat</p>
</div>
<div class="content-large"><img src="images/IMG_5499.jpg" style="width: 400px; padding-top: 100px; padding-left: 50px;"></div>
</div>
</body>
</html>
2
Answers
I recommend doing mobile first design. This is when you write your code for mobile devices and then use media queries to design for tablet and desktop. Here’s an example of a media querie:
in the header add the viewport meta tag like this
and learn about screen media in css, so you can create custom displays on mobile
and learn more about grid-template-columns because it affects the screen fit you want
grid-template-columns