How to fix bottom content from being cut at 100% size in Chrome dev tools?

I am finishing my tech portfolio so I can apply for a web developer job

my project page has some issues that I need some help fixing before I push it to live

my HTML:

<!DOCTYPE html>
  <html lang="en">
    <head>
      <meta name="viewport" content="width=device-width, initial-scale=1.0" />
      <meta charset="utf-8" />
      <title> ... Self-Taught Web Dev</title>
      <link rel="stylesheet" type="text/css" href="https://use.fontawesome.com/releases/v6.1.1/css/all.css" />
      <link rel="stylesheet" type="text/css" href="src/style.css" />
      <link rel="stylesheet" href="https://use.typekit.net/qyn2bvt.css">  <!--links Adobe font -->
      <link rel="icon" type="image/x-icon" href="favicon.ico"> 
    </head>
    <body>
      
          <div class="projects-gallery">
            <h1 class="page-2-title">My live projects so far</h1><br>
            <div class="whole-projects">
                <img class="project-img1" src="src/images/project-screenshots/project1.jpg"><br>
                <p class="project-description">Woocommerce website with</p>
                <p class="project-description">over 20 products in 6 languages and 3 currencies</p><br></div>
                <div class="button-for-projects-page">View live project</div>
              
            
            <!--project 2-->
            <div class="whole-projects">
                <img class="project-img2" src="src/images/project-screenshots/project2.PNG"><br>
               <p class="project-description">WordPress Blog</p><br></div>
              <div class="button-for-projects-page">View live project</div>
            
            <!-- project 3 -->
            <div class="whole-projects" id="third-project">
                <img class="project-img3" src="src/images/project-screenshots/project3.PNG"><br>
                <p class="project-description">Udemy Clone (in progress)</p><br></div>
              <div class="button-for-projects-page">View live project</div>
              
            </div>

          </div>
      </div>
      <a id="to-top-viewport" href="#"><i class="fa-solid fa-circle-up fa-3x"></i></a> 

    </body>
    </html>

my CSS (the last part relates to my projects-page):

* {
    box-sizing: border-box;
}


body {
    font-family: "gelato-luxe", 'Courier New', Courier, monospace;
    font-size: 25px;
    font-weight: 100;
    font-style: normal;
    color: #F9F9F9;
    max-width: 1900px;
}

h1, h2, h3, p  {
    text-align: center;
}

h2 {
    font-weight: 150;
    color: #fbf7cd;
    font-size: 30px;  
}

h3 {
  font-weight: 125;
  margin-bottom: -2.5rem;
}

#under-construction {
    margin-right: auto;
    margin-left: auto;
    display: block;
    width: 200px;
    height: 200px;
    margin-top: -20px;
    margin-bottom: -20px;
}


/* sections */

section {
    height: 600px;
}


.hero {
    background-image: url('...jpg');
    background-position: center; 
    max-width: 2000px;
    height: 100vh;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover; 
}

.hero-area {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

#made-by {
    font-weight: 300;
    font-size: 24px; 
    letter-spacing: 8px;
}

#made-by > a {                         /* #made-by > a denotes the parent-child relationship here */
    color: #fbf7cd;
    text-decoration: underline;
}

/* sections */


/* navbar and its components */

nav {
    display: flex;   /* shows navbar content in vertical line instead of stacked */
    justify-content: space-between;  /* shows logo on the top-left corner and the navbar on the top-right corner */
}

ul {
    display: flex;   /* shows the unordered list on the same horizontal line and stacked */
    list-style-type: none;
    justify-content: space-around; /* show all items within <ul> to have same space around */
    width: 500px; 
    font-size: 27px;
}

ul.show {
    display: block;
}

li {
    text-decoration: none;
}


.button {
    width: 170px;
    height: 70px;
    background-color: #faf4b7;                      /* button in hero section */
    color: #ecc5fb;
    border-radius: 50% / 100% 100% 0 0;   
    line-height: 70px;
    text-align: center;
    margin: auto;
    padding-right: 7px;
}

a {
    text-decoration: none;
    color: #ecc5fb;
}
   

a:hover {                                               /* anchor tags */
    color: #84d6c8;
    text-decoration: none;
}

li > a {
    color: #faf4b7;
}

li > a:hover {
  color: #cdf0ea;
}


.logo {
    width: 120px;
    height: 100px;
}


.mobile-menu-icon {
    max-width: 50px;
    max-height: 50px;
    
}

.hamburger {
    display: none;
}


@media only screen and (max-width: 1000px) {
    .hamburger {
        background-color: transparent;
        border: transparent solid 0;
        width: 50px;
        height: 50px;
        display: block;
        margin: 0px;
        align-self: flex-end;
    }

    ul {
        display: none;
        background-color: #fbf7cd;
    }

    li > a {
        color: #84d6c8;
    }

    li > a:hover {
        color: #ecc5fb; 
    }
    
    nav {
        display: flex;
        flex-direction: column-reverse;
        background-color: #fbf7cd;
    }
    
    .logo {
        display: none;
    }
}


@media only screen and (max-width: 2274px) {
    html, body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
}

@media only screen and (min-width: 280px) and (max-width: 900px) {
    html, body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
}

section {
    overflow-x: hidden;    /* removes extra white space from right side and bottom side
                              when opening mobile menu */

}

/* my project page */

.projects-gallery {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    flex-wrap: wrap;
    gap: 3rem;
    background-color: #cdf0ea;
    /*height: 100%;*/
}

.project-img1, .project-img2, .project-img3 {
    object-fit: cover;
    width: 55%;
    height: 45%;
    margin-left: 23rem;
    
}

.button-for-projects-page {
    width: 170px;
    height: 70px;
    background-color: #faf4b7;                      
    color: #ecc5fb;
    border-radius: 50% / 100% 100% 0 0;   
    line-height: 70px;
    text-align: center;
    margin: auto;
    padding-right: 7px;
    display: inline;
}

.project-description {
    color: #84d6c8;
    text-align: center;
    margin-bottom: -10px;
}


.page-2-title {
    color:#84d6c8;
    margin-left: auto;
    margin-right: auto;
    padding-top: 10px;
}

.whole-projects {
    background-color:#cdf0ea;
}



#to-top-viewport {
    position: fixed;
    color:#ecc5fb;
    bottom: 20px;
    right: 10px;
  }

  @media only screen and (min-width: 280px) and (max-width: 1024px) {
    .projects-gallery {
        display: flex;
        justify-content: center;
        align-content: center;
    }
    .project-img1, .project-img2, .project-img3 {
        margin-left: 4rem;
        margin-right: 0;
        width: 70%;
        height: 60%;
    }
}

most of the screen sizes (for example I attached screenshots of one of the screen size that has this issue (width: 375px and height: 667px)) have the 3rd project being cut out of the HTML when zoomed to 100% on Chrome dev tool. why and how do I fix it?

Also another issue, the images are more towars the right or left side of the screen depending on the screen size. How do I fix that too?



I do think the main problem behind this issues is the fact that you set explicit heights which is something not recommended in CSS as it will certainly cause layout issues. try removing the explicit heights and see what happens

removing heights did not change anything, any other tip on how to fix these 2 issues I have?

I struggling to see the issue exactly, If your website is deployed online can you please provide a link?

currently only the homepage is deployed, the project page is still present only locally

I don’t want to publish the project page unless I tested all of it and it looks good when tested on dev tools and on different browsers

I re-done the project page and I am doing my finishing touches :melting_face:

In the meantime I put my 2 main live projects on my LinkedIn. I got another recruiter wanting to chat about a nice job position, so they can see my live projects

1 Like

/* my project page */

.projects-gallery {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    flex-wrap: wrap;
    gap: 3rem;
    background-color: #cdf0ea;
    /*height: 100%;*/
}

.project-img1, .project-img2, .project-img3 {
    object-fit: cover;
    display: block;
    margin: 0 auto;
    max-width: 100%;
    /* width: 55%;
    height: 45%; */
    /* margin-left: 23rem; */
    
}

.button-for-projects-page {
    width: 170px;
    height: 70px;
    background-color: #faf4b7;                      
    color: #ecc5fb;
    border-radius: 50% / 100% 100% 0 0;   
    line-height: 70px;
    text-align: center;
    margin: auto;
    padding-right: 7px;
    display: inline;
}

.project-description {
    color: #84d6c8;
    text-align: center;
    margin-bottom: -10px;
}


.page-2-title {
    color:#84d6c8;
    margin-left: auto;
    margin-right: auto;
    padding-top: 10px;
}

.whole-projects {
    background-color:#cdf0ea;
}



#to-top-viewport {
    position: fixed;
    color:#ecc5fb;
    bottom: 20px;
    right: 10px;
  }

  @media only screen and (min-width: 280px) and (max-width: 1024px) {
    .projects-gallery {
        display: flex;
        justify-content: center;
        align-content: center;
    }
    /* .project-img1, .project-img2, .project-img3 {
        margin-left: 4rem;
        margin-right: 0;
        width: 70%;
        height: 60%;
    } */
}

OK my friend , I managed to fix the second issue your images move towards the right or left depending on the screen because you set margin-left on them and in the media query you set the margin again which caused that issue , what i did is I removed those margins and turned the images into blocks using the display property then I centered those images by setting margin left and right to auto removed the explicit width and height and replaced them with a max-width to improve responsiveness
I also removed the media query part on the images since that was also causing an issue I hope this waht you ae looking for
So far I cannot understand the first issue if you can plz explain more
Note: since I did not have your screenshots I used dummy pohtos with this screen sizes
600px/300px
650px/400px
800px/300px

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.