ul { padding: 0; list-style-position: inside; list-style-type: decimal; } #hello { margin: 1rem 0; } #contact { border: 1px solid var(--text-dim); box-shadow: 5px -5px 0px #999, 10px -10px 0px #666, 15px -15px 0px #333; padding: 1rem 2rem 1rem 1rem; /* allocate the space for the boxshadow */ margin-right: 15px; max-width: var(--pwidth); height: min-content; } #banner { max-width: min(100%, calc(var(--pwidth) + 15px)); border: 1px solid var(--text-dim); } #contact>h2 { margin-top: 0; } #contact>ul { margin: 0; list-style: none; padding: 0; } @media (max-width: 50rem) { #contact { margin-top: 2rem; margin-right: 1rem; } #banner { margin-top: 1rem; } } @media (min-width: 50rem) { #hello { display: grid; grid-template-columns: 30rem 1fr; row-gap: 1rem; column-gap: 1rem; width: fit-content; } #hello>p, #hello>h1 { grid-column: 1 / 2; margin: 0; } #hello>#contact { grid-column: 2 / 3; grid-row: 2 / 5; width: fit-content; } #banner { max-width: 16rem; grid-column: 2; grid-row: 4 } }