How div elements inside a nested div within a grid behave in terms of responsiveness

In an effort to achieve full responsiveness for multiple divs within a parent div, there are several similar parent divs housed in a grid view with the class "col-md-6." Attempts were made to adjust image width and font size without success. The goal is for elements to automatically adjust when screen size is reduced while maintaining complete visibility of values. The code and issues have been shared below along with corresponding screenshots.

CSS

.games-table{
    padding: 30px;
}

/* Additional CSS code included here */
...

@media only screen and (max-width:480px){
   /* Further adjustments at smaller screen sizes */
} 

HTML CODE

<div class="game-table">
    <div class="container-fluid">
        <div class="row">  
            ... 
        </div>
</div>

Screenshots

Full Width on laptop

1140x570 pixels view

iphone6,7,8 view

ipadpro view

Answer №1

It seems like your question covers a lot of ground, but I'll try to give you a high-level overview of how to approach your project.

It looks like you're utilizing bootstrap for styling, which is great for ensuring compatibility across different screen sizes.

Your code structure could benefit from some tidying up, as it appears a bit scattered. When organizing your divs, start with the larger grid first.

For example:

<div class="col-xs-12 col-md-6 col-sm-12 col-lg-6">

should be rearranged as

<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12>   // in hierarchical order 

First address this issue.

Furthermore, maintain a mentality based on grids. Within a grid, subdivide into smaller grids as if crafting a full page so that everything aligns seamlessly, just like with your parent grids (in an ideal scenario!).

A potential pitfall of grids arises when one box contains more text than another, causing misaligned heights. To counteract this, assign fixed heights to your boxes or ensure uniform text lengths. For larger screens, adjust these heights using @media queries. This simplifies the concept of 'responsive websites'.

When it comes to CSS:

.my-fixed-height-box-01 {
    height: 3em;     // customize to suit your design
    }

@media only screen and (max-width:600px) {
    .my-fixed-height-box-01 {
    height: 4em;     // customize to suit your design
    }
}

@media only screen and (max-width:480px) {
    .my-fixed-height-box-01 {
    height: 6em;     // customize to suit your design
    }
}

Bootstrap includes design components for images that automatically adjusts their responsiveness.

Maintain clean and organized code that serves as a solid foundation for future development. If you encounter specific challenges along the way, don't hesitate to turn to platforms like Stackoverflow for assistance.

Answer №2

My previous response provided a theoretical approach to designing grids.

In my solution, I opted not to use tables due to design limitations that can hinder scalability. However, if necessary, tables can be utilized.

If I were to recode the project, I would take a different approach.

I implemented some @media queries for responsiveness.

One key consideration when aligning images within grids in responsive design is ensuring they are all the same size. Even a 1px variation can cause visual discrepancies.

In this case, I adjusted image sizes to 200px height and width each to maintain consistency across different screen sizes. It's important to note that converting images from .png to .jpg format can reduce file size and improve page loading speed, unless transparent backgrounds are required. For thumbnail usage, consider reducing image sizes further based on screen dimensions.

The CSS code snippet included defines various styling rules for the layout, including box shadows, border radii, padding, and other design attributes.

The HTML markup provided showcases how the grid structure is set up using Bootstrap classes for column sizing and content organization.

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

Performing calculations involving both select and checkbox input values, as well as handling negative numbers

Seeking assistance in creating a feature where users can select a billing term from a dropdown and then choose checkboxes to add to the total. While it works fine on JSFIDDLE, I encounter issues on my website - specifically when selecting all checkboxes, r ...

Angular text input with customizable placeholder text and embedded icon

Hey there, I'm looking to create a unique custom textbox that includes a text placeholder and a help icon that will display useful information in a popover. https://i.sstatic.net/Zh0IK.png When typing into the input, the textbox should have a specif ...

jQuery unable to target Bootstrap button

I've been experiencing some trouble trying to attach a listener to a button I made with Bootstrap. <button type="button" id="buttonone" class="btn btn-default btn-lg good"> <span class="glyphicon glyphicon-minus" aria-hidden="true">< ...

Text in anchor vertically centered across browsers

Take a look at my JsFiddle project here: http://jsfiddle.net/JxXHE/ I want to ensure that the text in the menu items is perfectly centered vertically, with an 8px margin from the top and bottom in all browsers that are supported. The list of supported bro ...

Chosen option - Selection Menu - Relational Database Language

I am currently working on a dropdown list that needs to be filled from a database: <TH> <FORM> <p>Department</p> <SELECT size="1" id="depart"> <OPTION> <?php ...

Deactivate the collapse toggle feature in the footer navigation

I've recently started using bootstrap and I'm having some trouble adding a social nav footer to my portfolio. I've experimented with removing different classes and even tried using the sticky footer feature, but it's not quite what I ne ...

Is there a way to deactivate tabs in Bootstrap?

Is there a way to deactivate tabs in Bootstrap 2.0 similar to how you can disable buttons? ...

What is the best way to implement next and previous buttons in a slideshow using code?

Looking to enhance my slideshow by replacing the standard "Next" and "Previous" text buttons with custom JPEG images I've created. Anyone familiar with the steps needed to make this switch in the HTML code? Current HTML code in use: <body sty ...

Unable to eliminate a persistent purple dashed section within the div

After gaining some knowledge of CSS and flexbox, I decided to create a Landing brochure site. However, I encountered an issue that I couldn't solve on my own during the building process. I'm attempting to eliminate the Purple dashed area by exten ...

CSS - Struggles with Keeping Div Positioned to the Right of Another

I'm facing a simple layout issue here - trying to align two divs next to each other. Image on the left, text on the right. However, when the text is too long, it pushes the div down instead of wrapping around. I want the cs-summary div to automaticall ...

Issue with Foxpro Website Front End preventing reading from Drop Down List

Hey there, I'm currently in the process of developing a website to serve as a Foxpro front end. Everything is generally going well, but I've encountered an issue with my drop-down box that needs to retrieve a list of names from another Foxpro t ...

Is there a way to implement seamless scrolling within an absolute element using Jquery?

Hey there! I recently implemented smooth scrolling on my website, but it seems to only work on single-page layouts. How can I make it function properly within an absolutely positioned scrollable element? Here are the link to my website and the correspond ...

How can I utilize JQuery to dynamically refresh a dropdown menu?

My dropdown list is initially empty: <div> <label>Boarding Point </label> <select title="Select pickup city" id="boardingDropdown"> </select> </div> I am trying to popula ...

What could be the reason for the padding not functioning properly on my Bootstrap 5.3 webpage?

What could be the reason for pe-5 not functioning properly? <head> <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="10727f7f64636462716050253e233e22">[email protect ...

Diagonal Border Line with CSS3

Looking to create a box with a unique design element - specifically a diagonal line on the bottom right border as shown in the image below: If anyone has a creative solution that does not involve using a background image, I would appreciate any suggestion ...

How can I make the navbar in Angular stay fixed in place?

After using the ng generate @angular/material:material-nav --name=home command to create a navbar, I am trying to make it fixed at the top while scrolling. I attempted using position: fixed; on my mat-sidenav-content but it didn't work. Does anyone ha ...

Stop a form field from being visible on the screen

I'm working on a project where I would like to hide the user field in the form. models.py class Questions(models.Model): user=models.ForeignKey(User) category=models.ForeignKey(Categories) question=models.TextField(max_length=500) cr ...

What is the best way to bring in Javascript files to a specific component along with HTML and CSS?

` <script src="./jquery.min.js"></script> <script src="./bootstrap.bundle.min.js"></script> <!-- Core plugin JavaScript--> <script src="./jquery.easing.min.js"></script> <!-- Page level plugin JavaScr ...

Tips for enhancing the display of tables on mobile devices?

I am currently utilizing for creating a table This is the HTML code I have implemented: <table class="responsive-table"> <thead> <tr> <th>Mon</th> <th>Tue</th> <th>Wed</th ...

Ignoring HTML Validation Error in Visual Studio

Within my ASP.NET HTML markup, I frequently use a custom attribute that unfortunately violates the DTD and triggers a validation error in Visual Studio. Ignoring errors is not an option for me, so I am wondering if there is a way to suppress this specific ...