Is the viewport height feature malfunctioning in Bootstrap?

I'm facing an issue with setting the view port height for two columns in React-bootstrap. Despite my efforts, both columns end up having the same height which is not the desired outcome. I'm unsure if this is a mistake on my part or not. Here is the code snippet for reference:

import React from "react;
import Container from "react-bootstrap/Container";
import Row from "react-bootstrap/Row";
import Col from "react-bootstrap/Col"

const AdminPanel = () => {
  const users = [{ name: "Talha" }, { name: "Ali" }];
  return (
    <Container className="pt-5">
      <Row className="d-flex justify-content-around">
        <Col className="vh-50 border border-primary col mx-5">
          {users.map((user) => (
            <Row className="py-2 px-2">{user.name}</Row>
          ))}
        </Col>
        <Col className="border border-primary mx-5">
          <h1>
            list list list list list list list list list list list list list
          </h1>
        </Col>
      </Row>
    </Container>
  );
};

export default AdminPanel;

Here is the screenshot of the result: Result

I would appreciate any assistance in resolving this issue.

Answer №1

An issue arises with the use of .vh-50 as it is not a defined class in Bootstrap's stylesheet. Upon inspection, there are no instances of .vh-50 mentioned in their styles, but rather only .vh-100 and .min-vh-100 for viewport height definitions. To address this, the solution is to define the .vh-50 class in your own custom stylesheet.

.vh-50 {
  height: 50vh;
}

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

What are the best strategies for designing a table in React JS?

Description I've managed to create a table, but I feel like my code is too complex and not very straightforward. Here is the current code snippet: https://i.sstatic.net/2MYpU.png const FormCreateRole = ({ switches, onChange }) => { // Code for ...

show a feature through exporting in a react component

I'm currently learning React by tackling a problem in React. Below is the React code challenge I'm working on. However, I encountered an error in the browser that I couldn't resolve even after searching on Google. I've included my code ...

Activating Bootstrap modal when a navigation link is clicked

Just started a site for a client and new to Bootstrap. I've got the layout down - full-width page with "Top Nav" within the nav bar, looking to create a modal effect drop-down. When clicking on "About", it should trigger the .modal function. However, ...

Delete the CSS class from a specific HTML element

Having just started learning HTML and CSS, I encountered an issue. I applied a CSS class to a table element. Subsequently, I inserted a child table within the parent table. The problem arose when the CSS class of the parent table also influenced the child ...

What are the steps to resolve the "TypeError: Object(...) is not a function" error?

I've hit a roadblock while working on my Netflix clone app in nodejs, specifically with the generateMedia function. In the TabContentOne.js file, when I try to import { generateMedia } from 'react-media-query', it gets dotted out. Even afte ...

Aligning radio button vertically in React using Bootstrap styling

I am struggling to align a radio button within a container inline with other buttons on the right. Can anyone provide guidance on how to resolve this issue? Here is my current setup: https://i.sstatic.net/SSWZe.png Code: import React, { Component } from ...

Platform not compatible with issue installing [email protected]

I've been struggling to deploy my application on Vercel for quite some time now and have gone through numerous posts here on Stack Overflow discussing the same or similar fsevents issue. Regardless of all my efforts, I keep encountering the same error ...

Ways to conceal a division by selecting an anchor button on this element

One thing I'm curious about is how to hide only the current div that I click on. Any suggestions on how to achieve that? $('.ads-close-btn').click(function() { $('.full-width-add').hide("slow"); }); alert('My main qu ...

Material UI Input Field, Present Cursor Location

Is there a way to retrieve the current cursor (caret) position in a MaterialUI text field? https://material-ui.com/components/text-fields/ I am looking to make changes to the string content at a specific index, such as inserting a character X between cha ...

Removing Content with React

I attempted to remove the item, but when I click on the button the function does not work! Deleting in the backend is functional, however it does not work in the frontend! This is the delete function: deleteblog = async id => { // this.setSta ...

Border added to Bootstrap layout with 5 columns

Trying to figure out the best way to create a 5 column layout in Bootstrap with borders and spacing. https://i.sstatic.net/CG5MX.jpg A custom class has been created to accommodate the 5 column grid setup: .col-xs-15, .col-sm-15, .col-md-15, .col-lg-15 { ...

Developing a bespoke React component library - encountering an issue with 'react module not found' during Jest testing, as well as using testing-library

I am in the process of creating a bespoke react component library to be shared across various applications. To build this library, I am utilizing rollup and referencing resources such as this blog post along with others: https://dev.to/alexeagleson/how-to- ...

What is the best way to showcase my background image using html and css?

I've come across a similar topic addressing my problem, but I am still unable to resolve it. I am attempting to add a background image to my portfolio, but for some reason, it is not working. Can anyone offer any suggestions or ideas? Here is the cod ...

substitute elements within an array using elements from a different array

Looking to swap object(s) in an array with another array while maintaining the original order. Here is arrayOne: [ { "color": "#f8edd1", "selected": true }, { "color": "#d88a ...

Is it possible to retrieve all data from a single useMemo in React?

I'm trying to optimize my code by using just one useMemo instead of multiple React.useMemo blocks. Here is the current version: const App = () => { const isChecked = React.useMemo(() => { const source = get(data, 'somesource&apo ...

Showcase - Text aligned with image inside a container on a list item

I am currently facing the following situation, which I will illustrate with images: 1st scenario: In the image below, there is a small text and I have encountered an issue. The edge of my list does not align properly with the picture. I would like it to a ...

Issue with displaying svg images on Samsung Galaxy S7 mobile device

Having trouble filling an SVG image on my Samsung S7 mobile. It works perfectly fine on other devices. style="fill:white;" ...

Load images in advance using jQuery to ensure they are cached and retrieve their original sizes before other activities can proceed

When a user clicks on a thumbnail, I aim to display the full-size image in a div. To achieve this, I want to determine the original size of the image based on its source URL before it loads, allowing me to set the appropriate dimensions for the container. ...

Switching the background hue of the chat box after each message

Does anyone know how to change the colors of each message in a chat window using CSS and HTML? I'm trying to customize my stream but can't figure it out. Here is an example for reference. ...

Content displayed in the center of a modal

Struggling to center the captcha when clicking the submit button. Check out the provided jsfiddle for more details. https://jsfiddle.net/rzant4kb/ <script src="https://cdn.jsdelivr.net/npm/@popperjs/<a href="/cdn-cgi/l/email-protection" class=" ...