Back in the day, I had no problem getting my header, content, and footer to resize proportionally across different devices just by setting the width to 100%. But for some reason, it's not working this time. I can't figure out why. I still need to work on the footer, though.
*. {
width: 100%;
}
body {
font-family: Andale Mono, monospace;
}
p {
font-size: 24px;
}
.header {
padding: 200px;
text-align: center;
background-color: #001f4d;
}
.header h1 {
font-size: 64px;
color: white;
}
.header p {
color: white;
}
/* Begin main-content */
.content {
background: #0d0d0d;
padding: 80px;
color: white;
}
#main-title {
text-align: center;
font-size: 36px;
}
#main-paragraph {
margin: 400px;
max-width: 1000px;
margin: auto;
}
.column {
float: left;
width: 33.33%;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Small devices (portrait tablets and large phones, 600px and up) */
@media screen and (max-width: 600px) {
.header {
width: 100%;
}
.content {
width: 100%;
}
#main-paragraph {
width: 100%;
}
.column {
width: 100%;
}
}
<!DOCTYPE html>
<html>
<head>
<title>Doug Cannon's Biography</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="header">
<h1>My Website</h1>
<p>Welcome to my website.</p>
</div>
<div class="content">
<h2 id="main-title">About Me</h2>
<p id="main-paragraph">Mollit officia quis officia nostrud culpa ad sunt quis nulla quis esse adipisicing ut. Ullamco mollit ad elit reprehenderit mollit in duis incididunt id sit laboris adipisicing nisi pariatur. Lorem ipsum ea ut qui in ea consectetur id adipisicing quis officia occaecat laboris id velit. Sunt ea irure ex nostrud elit enim dolor in ut anim cillum ad duis.</p>
<br><br><br>
<!-- Responsive column cards -->
<div class="row">
<div class="column" style="background-color:#aaa;">
<h2>Column 1</h2>
<p>Some text..</p>
</div>
<div class="column" style="background-color:#bbb;">
<h2>Column 2</h2>
<p>Some text..</p>
</div>
<div class="column" style="background-color:#ccc;">
<h2>Column 3</h2>
<p>Some text..</p>
</div>
</div>
</div> <!-- End main-content -->
<div class="footer">
<footer>
Douglas Cannon <span class="highlight">© 2019</span>
</footer>
</div>
</body>
</html>