The body and HTML elements are bloated with an excessive amount of

Before we dive in, check out this code pen.

CSS

<body>
  <div class="header">
    <img src="https://images.unsplash.com/photo-1586244439413-bc2288941dda?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1050&q=80" alt="" class="profile-image">
    <p class="name-text">
      Hello๐Ÿ‘‹๐Ÿผ <span class="IGHandle">| @something</span>
    </p>
    <div class="description">
      <p>Nothing here... just some lorem ipsum text</p>
    </div>
  </div>
  <div id="other-links">
   
  </div>
  <div id="social--main">
    <script type="text/javascript" src="js/addSocialItem.js" charset="utf-8"></script>
  </div>
</body>

</html>

SCSS

body {
  overflow-x: hidden;
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'Raleway', sans-serif;
  margin: 0;
  padding: 0;
}

* {
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none;

  &:active,
  &:hover,
  &:visited {
    text-decoration: none;
  }
}

.header {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: auto;

  .profile-image {
    z-index: 10;
    height: 175px;
    width: 175px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 5px 5px 20px rgba(#335d2d, 0.2);
  }

  .name-text {
    font-size: 20px;
    font-weight: 700;

    .IGHandle {
      font-weight: 500;
      color: rgba(black, 0.7);
    }
  }

  .description {
    max-width: 300px;
    padding: 10px;
    margin-bottom: 10px;

    p {
      font-size: 16px;
      color: rgba(black, 0.35);
      line-height: 1.4;
    }
  }
}

#social--main {
  display: grid;
  grid-template-columns: repeat(4, auto);
  grid-gap: 7px 7px;
  padding: 10px;
}

.social-item {
  margin: 7px;
  padding: 10px;
  display: inline-block;
  border-radius: 30%;

  .bx {
    align-self: center;
    font-size: 40px;
    padding: 0;
    margin: 0;
  }
}

#other-links {
  margin-bottom: 20px;
  margin-top: -15px;
  display: flex;
  flex-direction: column;
  align-items: center;

  .other-link {
    font-weight: 600;
    display: block;
    color: #2a3d66;
    position: relative;
    margin-top: 15px;
    width: 270px;
    height: auto;
    padding: 15px;
    font-size: 20px;
    background-color: rgba(#2a3d66, 0.2);
    border-radius: 20px;
  }
}

JS

/*jshint esversion: 6 */

var mainSocialtems = [{
  "name": "dribbble",
  "color": "234,76,137",
  "href": "",
  "classes": "bxl-dribbble",
}, {
  "name": "instagram",
  "color": "193,53,132",
  "href": "",
  "classes": "bxl-instagram",
}, {
  "name": "behance",
  "color": "23,105,255",
  "href": "",
  "classes": "bxl-behance",
}, {
  "name": "linkedin",
  "color": "0,119,181",
  "href": "",
  "classes": "bxl-linkedin",
},];

var socialMain = document.getElementById('social--main');

for (var i = 0; i < mainSocialtems.length; i++) {
  const linkContainer = document.createElement('a');
  linkContainer.setAttribute('class', 'social-item');
  linkContainer.setAttribute('href', mainSocialtems[i].href);
  linkContainer.setAttribute('style', "background-color: rgba(" + mainSocialtems[i].color + ", 0.08)");

  const link = document.createElement('i');
  link.setAttribute('class', 'bx ' + mainSocialtems[i].classes);
  link.style.color = `rgb(${mainSocialtems[i].color})`;
  linkContainer.appendChild(link);

  socialMain.appendChild(linkContainer);
}

var linkItems = [{
  "name": "2020 so far",
  "color": "207,117,0",
  "href": "",
}, {
  "name": "event update",
  "color": "106,25,125",
  "href": "",
},];

var linkBox = document.getElementById('other-links');

for (var i = 0; i < linkItems.length; i++) {
  const linkContainer = document.createElement('a');
  linkContainer.setAttribute('class', 'other-link');
  linkContainer.setAttribute('href', linkItems[i].href);
  linkContainer.setAttribute('style', "background-color: rgba(" + linkItems[i].color + ", 0.2); color: rgb(" + linkItems[i].color + ")");

  linkContainer.innerText = linkItems[i].name + " ";

  const linkIcon = document.createElement('i');
  linkIcon.setAttribute('class', 'bx bx-link-external');
  linkContainer.appendChild(linkIcon);

  linkBox.appendChild(linkContainer);
}

Everything looks good on desktop, but when viewed on mobile, the page seems to have excessive space and elements are shrinking despite being set in pixels.

Here's a visual reference

This issue is new to me and I'm struggling to identify the cause.

Any assistance would be greatly appreciated!

Thank you

Answer โ„–1

Before we dive into anything else, let's double-check that you have the meta viewport properly set up.

<meta
  name="viewport"
  content="width=device-width,user-scalable=no,minimum-scale=1,maximum-scale=1"
/>

Next, make sure to update your body's height property to min-height.
This adjustment ensures that users can scroll through content that exceeds the available viewport space. ๐Ÿ˜Š

body {
   overflow-x: hidden;
   min-height: 100vh;
   box-sizing: border-box;
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   text-align: center;
   font-family: 'Raleway', sans-serif;
   margin: 0;
   padding: 0;
}
...

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Trouble with padding in Twitter bootstrap

I am puzzled as to why the navigation links at the bottom of my page ("prev" and "next") are wider than the post teasers in my #bloglist above. I am currently utilizing twitter bootstrap with their provided scaffolding. Any insights or recommendations wou ...

Utilizing custom links for AJAX to showcase targeted pages: a beginner's guide

I am putting the final touches on my website and realized that it may be difficult to promote specific sections of the site because the browser address never changes. When visitors click on links, they open in a div using Ajax coding. However, if I want to ...

Tips on aligning data received as a response from a Perl script

Currently, I am utilizing a Jquery-Ajax call to a perl script in order to retrieve specific data. The perl script executes a database query and transmits the data back to the HTML page. while (my @data = $statement->fetchrow_array()) { print "$ ...

Tips for setting discrete mapper style in cytoscapejs?

Currently, I am defining the style of cytoscape.js through CSS and converting it to JSON format using this resource. My goal is to implement a discrete mapper for styling. It's similar to the scenario discussed in How to use a descreteMapper like on c ...

Tips for sending data through an AJAX call to the app.post() function in Express

I am currently working on a blog application using express and node. In order to save a blog post without using a database (as the posts are stored in an array), I need to pass an array of keywords to the app.post() method. To display keywords as separate ...

Transform pixel padding into percentage ratios

I've been searching through various discussions to find a solution, but none of them seem to fit my particular scenario. My issue involves a hyperlink with absolute positioning inside a div with relative positioning. The padding and margins are curre ...

The vertical scrolling issue arises when the content exceeds the height of the screen

Seeking a solution to enable scrolling of users within a flexbox menu, I've come across an interesting discovery. When setting a specific height in pixels for my nav element (like 100px), everything works perfectly. However, when I set the height to 1 ...

Personalizing the design of Bootstrap

As a beginner in working with Bootstrap, I am currently focused on creating an index html page for an online shop. For reference, here is an example - https://jsfiddle.net/a393wtng/1/ Upon resizing the output frame, it becomes apparent that 4 products can ...

Using the Strikethrough Feature in React

Is it possible to apply a strikethrough effect to a checkbox's label text when toggled on and off? In my system development process, I've utilized various methods. What modifications should be made in the fComplete method for this feature to wor ...

fill the designated column in accordance with the specific criteria

Is there a method to automatically fill in a specific column based on certain conditions? I am looking to populate the column labeled [Last] when the column index is 1 and the corresponding name is [First]. import {Component, OnInit} from '@angular ...

Customer is unable to locate the "InitializeAuthenticationService" function

After launching my application, the browser console keeps showing me three errors that all say Could not find 'AuthenticationService.init' ('AuthenticationService' was undefined). and Microsoft.JSInterop.JSException: Could not find &apo ...

Eliminating Unnecessary Stylesheets in Vite and Vue Website

When working on the Vite-Vue application, I noticed that the styles I implemented for both index.html and Vue components/views are showing up as crossed out in the browser. Additionally, many of the styles I added to the components/views are also being cro ...

Users using an iPhone are unable to adjust the scale or scroll on this website

I find myself wondering what I might be overlooking in this situation Here is the HTML code: <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="shortcut icon" href="../../nImg/favicon.ico" ...

CSS properties for SVG image borders not displaying correctly

I'm having trouble creating a border around a round SVG image with the class "lock feature". When I try to add the border in the CSS element ".lock feature", the text "feature" stays white and the border doesn't show up in the browser. However, i ...

Troubleshooting Challenges in JavaScript/jQuery Hangman Game

Having trouble with my hangman game's game loop. Attempting to replace correct letters as the game runs through the word, but it's currently: looping through the word checking if the guessed letter is in the word returns index[0] Tried splitti ...

Steps to import shared CSS using Styled-components

In my project using react, I've implemented styled-components for styling. One requirement is to have a shared loading background. Here is the code snippet of how I defined it: const loadingAnimation = keyframes` 0% { background-position: 95% 95%; } ...

What's the best way to arrange a series of images in a horizontal line using html and css?

Looking for a way to display a list of images in a straight line with just the right amount of spacing between them? Check out my fiddle and see the challenge I'm facing. I've been experimenting with HTML code to achieve this look. Here& ...

best practices for choosing items from a dropdown menu using Angular

I have a dropdown list displaying existing tags/chips created by users in the past. However, I'm having an issue where when I select a tag from the dropdown list, it doesn't show up in my input field (similar to the Chart tag currently). I am abl ...

Looking for search suggestion functionalities in an HTML input field

I am currently working on a website project and have a database filled with recipes to support it. The issue I am facing is related to the search feature on my webpage. At the top of the page, there is a textarea where users can input their search queries ...

Discovering the source of the parent link within html.tpl.php

Is there a way to determine the parent page title within html.tpl.php? I need this information to change the background image based on the selected parent link. Here is the URL for reference: Thank you, Ron I couldn't find a solution to this problem ...