CSS CSS Layout Basics Getting Started with CSS Layout Using a Mobile First Approach

yannis sousanis
yannis sousanis
7,199 Points

I tried this on my own and it worked when it the screen when it was small but when I full expanded it the width was 100%

  • { box-sizing: border-box; }

body { font-family: "michroma", sans-serif; background-color: lavender; }

h1 {

margin-top: 3em;
margin-left: 10%;

}

.wrapper { padding-left: 1em; padding-right: 1em; background-color: lightgrey; margin: 0 auto;

}

.pers-info { text-align: right; float: right; }

/* ================================= Media Queries ==================================== */

@media (min-width: 769px) { .container { width: 80%; max-width: 800px; margin: 0 auto; }

} This is the css code I used . What is wrong?

1 Answer

Emmanuel Molina
Emmanuel Molina
9,265 Points

Seems good. Is the .container class correctly written in your HTML ?