0

as you can see the three boxes at the bottom do not stack on top of each other when in mobile mode. I have been searching for hours and I cannot seem to find a right solution.

What I need is for everything to be mobile friendly. Meaning everything will fit on a mobile screen perfectly. I have tried multiple "solutions" for this problem however non of them seem to be working. Thank you in advance for any replies.

.header {
    background: url('https://webgradients.com/public/webgradients_png/019%20Malibu%20Beach.png') no-repeat center center fixed;
    -webkit-background-size: cover; /* For WebKit*/
    -moz-background-size: cover;    /* Mozilla*/
    -o-background-size: cover;      /* Opera*/
    background-size: cover;
    padding: 30px 30px;
    text-align: center;
    color: white;
}

.header > h1 {
    font-weight: 900;
}

.hooker {
    text-align: center;
    padding-top: 110px;
    color: #17202A;
}   

.hooker > h1 {
    font-weight: 900;
    font-size: 50px;
}

.hooker > p {
    padding-top: 15px;
    font-size: 20px;
}

hr {
    margin: 100px;
}

.about-container {
    margin: auto;
    display: flex;
}

.about {
    display: block;
    margin: auto;
    background-color: white;
    border: 1px solid white;
    border-radius: 5px;
    width: 700px;
    text-align: center;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    margin-top: 50px;
}

.about > h1 {
    font-weight: 600;
}

.about > p {
    font-size: 20px;
    padding-top: 20px;
}

.projects-left {
    display: block;
    background-color: white;
    width: 400px;
    float: left;
    border: 1px solid white;
    border-radius: 5px;
    margin: 50px;
    text-align: center;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    height: 400px
}

.projects-middle {
    display: block;
    background-color: white;
    width: 400px;
    border: 1px solid white;
    border-radius: 5px;
    margin: auto;
    text-align: center;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    height: 400px
}

.projects-right {
    display: block;
    background-color: white;
    width: 400px;
    float: right;
    border: 1px solid white;
    border-radius: 5px;
    margin: 50px;
    margin-top: -355px;
    text-align: center;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    height: 400px
}

.box {
    margin: 30px;
    padding: 20px 400px;
}

.page-content {
    text-align: center;
    display: block;
    border: 2px solid white;
    border-radius: 5px;
    background: white;
    padding: 0px 0px;
    margin: 25px;
    height: 600px;
    width: 600px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.page-content-within {
    display: block;
    padding: 15px 15px;
}

.bar {
    width: 500px;
    height: 40px;
    font-size: 20px;
}

.button {
    background-color: #4C81FF;
    border-radius: 5px;
    width: 150px;
    height: 70px;
    border: 1px solid black;
}

.text-box {
    width: 600px;
    height: 60px;
}
<!doctype html>
<html lang="en">
    <head>
        <title>Caleb Kutz's Portfolio Site</title>
        <link rel="stylesheet" href="main.css">
        <script src="app.js"></script>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>

    <body>
        <div class="header">
            <h1>Caleb Kutz</h1>
        </div>
        
        <nav class="navbar navbar-inverse">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand" href="index.html">Portfolio</a>

                    <ul class="nav navbar-nav">
                        <li><a href="contact.html">Contact me</a></li>
                    </ul>
                </div>
            </div>
        </nav>

        <div class="hooker">
            <h1>Hello, my name is Caleb.</h1>
            <p>Your satisfaction is my guarantee.</p>
        </div>

        <hr style="margin-top:50px;">

        <div class="about-container">
            <div class="about">
                <h1 style="text-decoration:underline;">About</h1>
                <p style="padding-top:50px; padding:40px;">Hello, my name is Caleb. I am a freelancer. I have two years of experience with: <p style="font-weight:bolder;">React.js, Html5, Css3, JavaScript, Python, C++, and Flask (a web development framework with python).</p></p>
            </div>
        </div>

        <hr style="margin-top:50px;">

        <h1 style="font-weight:900; text-align:center; margin-top:30px; text-decoration:underline; margin-bottom:100px;">My Projects</h1>

        <div id="column" class="projects-left">
            <h1>Emailing App</h1>
            <img src="emailinglogo.png">
            <br>
            <a href="https://github.com/CalebMKu/Emailing-Application" class="btn btn-primary btn-lg">&lt;/&gt; View code</a>
        </div>

        <div id="row" class="projects-middle">
            <h1>Socket</h1>
            <img src="socketlogo.png">
            <br>
            <a href="https://github.com/CalebMKu/socket" class="btn btn-primary btn-lg">&lt;/&gt; View code</a>
        </div>

        <div id="three" class="projects-right">
            <h1>Password Encrypter</h1>
            <img src="passwordlogo.png">
            <br>
            <a href="https://github.com/CalebMKu/password-encrypter" class="btn btn-primary btn-lg">&lt;/&gt; View code</a>
        </div> 
    </body>
</html>
  • 3
    What solutions have you tried that didn't work? Did you try using media queries or grids or flex or Bootstrap some other framework? Your question is quite vague as there are *many* ways you can do this. However they pretty much all rely on media queries, so that is a good place to start if you want to do it yourself without a framework – FluffyKitten Sep 03 '20 at 18:32
  • The traditional solution is to design your website using media queries, and design the layout for the smallest screen size first. As the screen gets bigger, design different layouts for bigger screens. This is called the "mobile first" paradigm within the bigger "responsive design" paradigm. – TylerH Sep 03 '20 at 18:34
  • Whatever links that show up when you type "How to stack divs when in mobile mode" I have tried. –  Sep 03 '20 at 18:34
  • The first results I see are Stack Overflow questions (which isn't a good place to start, you need something more instructive than problem-fixing) then W3Schools 2-column and 3-column responsive layout which gives code examples, then [CSS Tricks - **how to stack elements in CSS**](https://css-tricks.com/how-to-stack-elements-in-css/) - all great resources. You might get better results if you search for is **responsive** design. Take a look at [W3Schools responsive media queries](https://www.w3schools.com/css/css_rwd_mediaqueries.asp) for a starting point. – FluffyKitten Sep 03 '20 at 18:39
  • the problem with that is I already have my own classes for the divs. Can I change the classes on that website to id's instead? –  Sep 03 '20 at 18:43
  • Having your own classes isn't a problem - just adapt the CSS examples to use *your* classes instead of theirs. You don't need ids (in fact, you're generally better to use classes for this, ids are too restrictive). – FluffyKitten Sep 03 '20 at 18:44
  • 1
    Start by reading [this article](https://alistapart.com/article/responsive-web-design/). And then read [this one](https://www.smashingmagazine.com/2011/01/guidelines-for-responsive-web-design/). After that you should be well-positioned to make great strides on this subject. – TylerH Sep 03 '20 at 18:46
  • I'd say put those projects in a container with `display: flex` ([docs](https://developer.mozilla.org/en-US/docs/Web/CSS/flex)), and change the widths to be dynamic (`vw` or `%` instead of `px`). Also look into [media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries). – Henry Woody Sep 03 '20 at 18:48

0 Answers0