Reduced resolution decreases image size significantly (bootstrap-5 Fluid)

What's Currently Happening: While using the Chrome browser's device toolbar tool to test my site at various resolutions, I observed that when I shrink the device screen to "Mobile-s" 320px, the content on my page becomes nearly unreadable. Additionally, the images become extremely small, and sentences get broken down to the point where single letters are stacked on top of each other.

Desired Outcome: I would like the content in the card to shrink as the screen resolution decreases, but remain readable with the images staying large enough to be visible.

Tools Used in My Project:

  1. HTML
  2. CSS
  3. Bootstrap 5

HTML for the Blog Section:

You can see that I'm utilizing container-fluid in my outermost div.

<h2 class="display-6 mb-5">My blog:</h2>
<div class="container-fluid">
<div class="row">
<div class="col-md-4 ">
<div class="card " >
<img src="img/1.jpg" class="card-img-top " alt="...">
<div class="card-body ">
<h5 class="card-title">Card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div>
</div>

HTML for the Images Section:

You can see that I'm also using container-fluid in my outermost div.

<h2 class="display-6">My projects:</h2>
<div class="container-fluid">
<div class="row gy-5"> 
<div class="col-md-6"><img src="img/1.jpg" alt="Portfolio image" class="img-fluid thumbnail">
</div>
<div class="col-md-6"><img src="img/1.jpg" alt="Portfolio image" class="img-fluid thumbnail">
</div>
<div class="col-md-6"><img src="img/1.jpg" alt="Portfolio image" class="img-fluid thumbnail">
</div>
<div class="col-md-6"><img src="img/1.jpg" alt="Portfolio image" class="img-fluid thumbnail">
</div>
<div class="col-md-6"><img src="img/1.jpg" alt="Portfolio image" class="img-fluid thumbnail">
</div>
<div class="col-md-6"><img src="img/1.jpg" alt="Portfolio image" class="img-fluid thumbnail">
</div>

CSS Included in My Project:

body, html{
height: 100%;

}

body{
font-weight: 200;
font-size: 1.5rem;
color: #444;
}

.intro-left{
background: url("img/1.jpg");/*concrete background*/
position: fixed;
left: 0;
width: 33.3333%;
height: 100%;
color: white;

}

@media(max-width: 768px) { 
.intro-left{
height: 80vh;
margin-bottom: 0;
position: relative;
width: 100%;
}

}

.avatar{
width: 10rem;
height: 7em;
border-radius: 50%;
margin: 1rem;
}

.full-height {
height: 100%;
}

.quote{
float: right;
}

section{
margin: 5rem;
font-size: 1.2rem;
}

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

How the Cards Currently Appear at 320px:

https://i.sstatic.net/az4li.png

How the Images Currently Look at 320px:

https://i.sstatic.net/niPLJ.png

Expected Appearance of Cards at 320px:

https://i.sstatic.net/187ZD.png

Expected Appearance of Images at 320px:

https://i.sstatic.net/CRjgg.png

Answer №1

Make sure to specify the size of the image div within col-md-6 and assign classes for different sizes.

For example:

<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-3 col-xxl-3">
    <img src="img/1.jpg" alt="Portfolio image" class="img-fluid thumbnail">
</div>

I suggest referring to the Bootstrap Grid System documentation for more information https://getbootstrap.com/docs/5.0/layout/grid/#grid-options

Answer №2

By decreasing the section margin, the size of elements will increase. This is because the margin applied to the section class creates a gap around the element. Initially, the gap was set at 5rem. As the resolution decreased, the margin gap remained at 5rem, causing elements using the section class to appear smaller on lower resolution screens. However, reducing the margin to 0.1rem minimized the gap around all sides, resulting in larger and more readable elements on lower resolution screens.

Original code:

section{
   margin: 5rem; 
   font-size: 1.2rem;
 }

Updated code:

section{
   margin: 0.1rem; 
   font-size: 1.2rem;
 }

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

Progress Bar Modules

I am currently working on creating a customizable animated progress bar that can be utilized as follows: <bar [type]="'health'" [percentage]="'80'"></bar> It is functional up to the point where I need to adjust different p ...

JavaScript Animation of Text

I have a challenge where I want to animate text's opacity in JavaScript after the user presses enter. However, I am struggling to achieve this with my current code. I can provide all of my code for you to review and help me understand why the animatio ...

The Bootstrap tab feature is malfunctioning when a tab is using data-target instead of href

While developing bootstrap tabs for an Angular app, I decided to use the data-target attribute instead of the href attribute to avoid any interference with routes. Here's a snippet of how I structured the tabs: <ul class="nav nav-tabs" id="myTab"& ...

Jquery not functioning properly for show and hide feature

I'm new to using Jquery and JqueryUI. I have a div named front, which I want to initially display on window load and then hide it by sliding after a delay of 5500 milliseconds. However, I'm encountering errors in the jquery.min.js file. The HTML ...

Tips for including a lang attribute in HTML tags within Next.js

When I ran a performance check on my Next.js portfolio site, I discovered that the main index.html is missing a lang attribute. This absence results in a deduction from the accessibility score. I could add the locale by configuring i18n setup in the next. ...

Running JavaScript code along with HTML elements extracted from a jQuery ajax callback

Alternatively, not exactly "executing," but rather updating a pre-existing function with a function returned in the response. Step 1 I have an HTML5 page detailing a specific location. The server-side includes a ColdFusion file called "MapFunction.cfm" ...

Identifying the completion of loading a HTML page using an object tag

I am trying to load an HTML page using an object tag, and once the page is fully downloaded, I want to display something. I have attempted the following approach, but it is not working: document.querySelector(".obj_excel").addEventListener("load", funct ...

How can I align the kendoMenu in the center when the menu width is unpredictable?

Presenting a modified menu structure: <html class="k-webkit k-webkit40"> <head> <title>Site Title</title> <!-- js and css files referenced here --> </head> <body> <link h ...

Stop Element-UI from automatically applying the list-item style to li elements

I have a list of data elements that I am rendering in the following way: <ul> <li v-for="el in elements"> {{el.data}} </li> </ul> Here's how I style it in my .css file: ul { list-style-type: none; padd ...

encountering difficulty incorporating menu.php within main.php

I'm currently working on integrating the menu.php file into my main.php. Here is what I have accomplished so far: Main.php <html> <body> <?php include("menu.php"); ?> <p>This is an example to demonstrate how ...

Prevent any pop-up windows from appearing when a specific link is clicked

On my website, I have implemented popup advertising where ads open when clicked inside the body. However, I am looking to disable popups when a link with the class donot is clicked. Currently, when the donot link is clicked, a popup opens and the link doe ...

Tips for accessing information from a FOR loop within DIV tags

Let's explore the following code snippet: Here is the HTML generated: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Website ...

Leveraging jQuery within a dynamically loaded div

I am attempting to implement some jQuery on a page that is loaded into a div using the .load() function. The PHP code loaded into the div contains a hidden section that slides out when a link is clicked. However, I am facing an issue where the div slides b ...

Make window.print() trigger the download of a PDF file

Recently, I added a new feature to my website allowing users to download the site's content by following these instructions: Printing with Javascript || Mozilla Dev. Essentially, the user can print a newly formatted site stored in a hidden iframe. Now ...

Personalize the position of the v-select drop-down menu

I am currently working with the vuetify v-select component. The problem I am encountering is that instead of the dropdown opening downwards, I need it to open upwards since the dropdown is positioned at the bottom of the page which causes some of the dro ...

Express application encountering issue with loading CSS and script files, resulting in net::ERR_ABORTED 404 (Not Found) error

I am facing an issue with my express backend server. When it launches, it is supposed to render an EJS page with index.js in it. However, I encountered 3 errors: Refused to apply style from 'http://localhost:3000/public/styles/style.css' because ...

Exploring the World of Html

I'm struggling with an HTML problem related to a web programming class I'm taking. The assignment involves creating a video game using HTML and JavaScript, where an image moves randomly on the screen and the player must click on it as many times ...

Tips for adjusting column positions in a table while maintaining a fixed header and utilizing both horizontal and vertical scrolling

Is there a way to display a table that scrolls both horizontally and vertically, with the header moving horizontally but not vertically while the body moves in both directions? I have been able to shift the position of the columns, however, I am struggling ...

Tips on sending multiple values to AngularJS Directive

Currently, I am in the process of creating a simple AngularJS directive. As I am still very new to AngularJS, I would appreciate it if the answers provided could be simplified! The directive I am working on is essentially a combobox. For those unfamiliar ...

What is the best way to keep track of the number of checked checkboxes and add them to a separate div?

I need to select multiple checkboxes from different sections, count them, and then append the same number of sections to another div. ...