Looking to limit the size of the content to fit within the parent column's dimensions [using Twitter Bootstrap]?

One of the main challenges I'm facing is that the contents inside the bootstrap columns are not scaling properly to fit the size of their respective columns.

Here's the layout I'm aiming for: 1

This page consists of two separate columns:

  • Left column (c-carousel column): a bootstrap image carousel

  • Right column (gm-group members column): name and picture of each member of the group

    • The right column is divided into 1 title row and 10 additional rows, each containing two columns

Each main column is set to "max-height: 100%; max-width: 100%;", however, their contents (carousel and group members columns) do not adhere to these dimensions. The content in either the c column or gm column extends beyond the height of the other column on larger or smaller screens, resulting in blank spaces like the yellow area below. Although I've adjusted the gm column's content to fit within its dimensions, there is still overflow which I've hidden, but this solution requires scrolling to view the last member.

I'd prefer the carousel to crop images as needed to fit within its constraints and have the group members column's content adjust to fit the column without necessitating scrolling through members. Unfortunately, after trying for three days, I'm unsure how to achieve this. Thank you in advance for any assistance.

2

Here is the relevant code:

        
        // CSS styles here...

    </style>
</head>

<body>
    <div class="container-fluid">
        <?php include 'navigation.php';?>
    </div>

    <div class="row no-gutters">
        <div class="col-lg-9 col-xs-12" style="padding-right: 0px; max-width: 100%; max-height: 100%; background-color: yellow;">
            // Bootstrap carousel code here...
        </div>

        <div class="col-lg-3" id="fullnamediv" style="max-width: 100%; max-height: 100%; overflow: auto;">
            // Group members display code here...
        </div>
    </div>

p.s. Please excuse any duplicate or unused sections in the code; I plan to optimize it later. Thank you once again for your help :)

Answer №1

Give this code a try, it should assist you:

body{
overflow-x: hidden;
}

.carousel-inner{
border-bottom: 40px solid yellow;
}
.item{
height: calc(100vh - 40px);
}
.user-detail{
display: inline-block;
}
.user-detail p{
margin: 0;
float: right;
padding-left: 40px;
line-height: 40px;
}
img.headshots{
border-radius: 50%;
}
#mobilenamediv{
display: block;
text-align: center;
}
#fullnamediv{
height: 100vh;
}
.banner-sec .col-lg-9, .banner-sec .col-lg-3{
padding-right: 0px;
padding-left: 0px;
}
.top{
font-family:Impact, 'Arial Narrow Bold', sans-serif;
font-size: 1.8em;
}
#name{
display: flex;
align-items: center;
height: calc(100vh / 11);
font-weight: bold;
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: 1.3rem;
color: white;
background-color: #467095;
border-bottom: 1px solid #fff;
}
#name:hover{
background-color: white;
color: #467095;
}
.headshots{

vertical-align: middle;
height: 40px;
width: 40px;
}
#imageText{
position: absolute;
bottom: 20px;
right: 20px;
background-color:rgba(0, 0, 0, 0.6);
color: white;
padding-left: 10px;
padding-right: 10px;
font-size: 3rem;
}

#IMTextTitle{
font-weight: bold;
font-size: 2.5rem;
}

#IMText{
font-weight: 500;
font-size: 1.8rem;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<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">
<link rel="stylesheet" type="text/css" href="style/style.css">
</head>
<body>
<div class="banner-sec">
<div class="row">
<div class="col-lg-9 col-xs-12">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" >
<div class="item  active">
<img src="images/dish.png" class="img-fluid" alt="Responsive image">
<div class="carousel-caption" id="imageText">
<div id="IMTextTitle">Industry Tour:</div>
<div id="IMText">Turner Studios and Adult Swim Studios</div>
</div>
</div>
<div class="item">
<img class="d-block w-100 h-100" src="images/1.jpeg" alt="Second slide">
<div id="imageText">
<div id="IMTextTitle" >Research Talk:</div>
<div id="IMText" >Recording Studio Basics and Signal Flow</div>
</div>
</div>
<div class="item">
<img class="d-block w-100 h-100" src="images/3.jpg" alt="Second slide">
<div id="imageText">
<div id="IMTextTitle">Industry Tour:</div>
<div id="IMTextTitle">Turner Studios and Adult Swim Studios</div>
</div>
</div>
<div class="item">
<img class="d-block w-100 h-100" src="images/2.jpeg" alt="Third slide">
<div id="imageText">
<div id="IMTextTitle">2019 REU Researchers</div>
</div>
</div>
<div class="item">
<img class="d-block w-100 h-100" src="images/dish.png" alt="Third slide">
<div id="imageText">
<div id="IMTextTitle">GSU VR Cave</div>
</div>
</div>
</div>
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<div class="col-lg-3" id="fullnamediv">
<div class="col-lg-12" id="name">
<div class="top text-center">Researchers : 2019</div>
</div>

:

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

Trying to align a Material UI button to the right within a grid item

I'm attempting to right float the button below using material-ui, but I'm unsure of how to achieve this: <Grid item xs={2}> <Button variant="contained" color="secondary&quo ...

libxml2 - deleting a child node without affecting its grandchildren

I'm working with libxml2 to parse HTML content and need to remove specific formatting tags such as <center>, while retaining their content (e.g. a hyperlink). This requires removing particular child nodes from my xmlNodeSet, while preserving th ...

Do not allow negative values to be displayed in the text box

Plunker I need to restrict negative values from being entered into a text field. If the user tries to input a negative value, I want the text box to remain unchanged. Although I have a directive that prevents negative values from being entered, it seems ...

What are the best strategies for creating HTML website designs that are both scalable, adaptable, and versatile?

As a beginner in HTML website design, I have recently started using HTML, CSS, jQuery, and JavaScript for designing websites. After creating a site with almost forty webpages, the client requirements are changing, requiring changes to be made across all ...

Creating Fixed/Sticky Headers for Tables within Tabs in Bootstrap 4

I'm working on a website using Bootstrap 4 and it features multiple tabs with different tables, some of which contain a large amount of data. I am looking to implement a feature where the table header remains fixed at the top of the page as the user s ...

Trouble with displaying the NVD3 sample chart

I seem to be missing something simple... I've copied the code for an nvd3 example exactly, but I'm getting a blank page without any error messages. Both the nvd3 and d3 libraries are showing up when I check in the console by typing "nv" or "d3", ...

Tips for improving the focus of the bootstrap datetime picker?

I have integrated the Bootstrap datetime picker (bootstrap-datetimepicker.min.js) into my code. Within the DIV tag, I have included the class="modal fade" to open the first popup. In the first popup, there is a datetime picker. When clicking on the picker ...

Is it possible to clear a row of images and then repopulate it with new images without losing the click listeners associated with each image?

I am currently developing a memory game that involves clicking on images as the main objective. After clicking on an image, the pictures are then rearranged on the page. However, if you click on the same image twice, you will lose and the game will reset. ...

Displaying or concealing HTML elements using AngularJS while a modal is open

Looking for a way to display a loading spinner icon on my page when a user triggers a button that opens a modal, and then have the spinner disappear once the modal is open and its content has loaded. Currently, I've managed to make the spinner show up ...

Incorporate Javascript to smoothly transition a div into view, display it for a specified duration, gradually fade it out, and ultimately delete

I am excited to experiment with toast notifications by creating them dynamically. Each toast has a unique id number and I increment a counter every time a new one is created. The current functionality includes the toast sliding down, staying visible for 3 ...

Automatically sorting data in JavaScript from PHP-generated JSON

When I receive JSON data from PHP and use it in JavaScript to populate a select box, the order is automatically sorted. This behavior should not occur. I am utilizing this JSON as the value for HTML select box options and I require the data to be in its o ...

Navigate to the first item on the menu in the Chrome browser

Why does the First Menu Item (.chosen) jump in Chrome Browser when refreshed? It seems like it's changing the Padding-Right and Padding-Bottom. Please review the code and help me solve this irritating issue. It works fine in Firefox. <body> ...

Tips for disabling default browser input validation in React

https://i.stack.imgur.com/834LB.png Is there a way to remove the message "Please fill out this field" while still keeping the "required" attribute intact? I have my own validation system in place, so I need to use the "required" attribute to determine whe ...

A single parallax transition designed exclusively for you

I am looking to add a unique parallax transition to my website, specifically one that features a nice scroll followed by a subtle bounce effect. For example, I want to incorporate an arrow that, when clicked, smoothly scrolls the user to the bottom of th ...

JavaScript - Uncaught TypeError: type[totypeIndex] is not defined

After following a tutorial and successfully completing the project, I encountered a JavaScript error saying "Uncaught TypeError: totype[totypeIndex] is undefined". When I tried to log the type of totype[totypeIndex], it initially showed as String, but late ...

Having trouble transferring my background image from my FTP to my website

I'm having trouble setting a background image for the header on my website. It seems that nothing is loading. The hosting service I use has disabled linking images via external URLs, so I tried uploading the image to Filezilla, but that didn't wo ...

Cross-browser compatibility problem: Firefox not displaying layout properly

I am encountering browser problems, as well as issues when using the same browser on a different computer. The links on my website are not positioned correctly over the background. When viewing with Firefox, the opacity and positioning features are not fu ...

`Switch up the backdrop upon selection`

I'm experimenting with bootstrap and hit a roadblock. I have radio buttons that I want to outline when not selected, and appear solid or "btn-primary" when selected. I could try achieving this with JavaScript by giving each button an individual ID, b ...

Should I incorporate PHP/HTML code or opt for using a function instead?

I'm currently exploring the most effective method for integrating HTML/PHP code into various pages, such as headers, footers, and other repetitive sections. Would it be better to use include_once(php file) (even if it's used multiple times on a ...

Why does my text keep drifting towards the left edge?

After spending a day learning CSS and HTML, I decided to recreate a website from a YouTube video and add my own customizations. I was able to center the text in my introduction successfully. However, upon reviewing my progress (see screenshot here), it is ...