the border only partially encasing the div

In this snippet of code, the structure is not fully encapsulated within the div element. There are two child divs positioned in a row format. Bootstrap and inline CSS styles have been utilized for the CSS styling. This particular code segment pertains to a project built using React.

<div className="bg-white d-flex flex-row flex-wrap justify-content-between border border-primary" style={{"width":"fit-content", "zIndex": "4", "borderTop": "#ffffff", "margin":"auto", "minHeight":"200px", "minWidth":"600px" }}>
            
                <div className="accesories text-start">
                    <p style={{ "color": "#7a7a7a", "margin":"0 10px" }}>Accessories</p>
                    <div className="accessories-heading d-flex flex-column justify-content-between flex-wrap text-start"  style={{ "maxHeight":"40vh" }}>
                        <div style={{"margin":"10px 10px"}}>AppleCare</div>
                        <div style={{"margin":"10px 10px"}}>AirPort & Wireless</div>
                        <div style={{"margin":"10px 10px"}}>Bags, Shells & Sleeves</div>
                        <div style={{"margin":"10px 10px"}}>Business & Security</div>
                        <div style={{"margin":"10px 10px"}}>Cables & Docks</div>
                        <div style={{"margin":"10px 10px"}}>Cameras & Video</div>
                        <div style={{"margin":"10px 10px"}}>Car & Travel</div>
                        <div style={{"margin":"10px 10px"}}>Cases & Films</div>
                    </div>
                </div>

                <div className="category d-flex flex-column justify-content-between flex-wrap text-start" style={{"margin":"0 0 0 10vw"}}>
                    <p style={{"color":"#7a7a7a", "margin":"0 10px" }}>Category</p>
                    <div className="category-heading d-flex flex-column justify-content-between flex-wrap text-start"  style={{ "maxHeight":"40vh" }}>
                        <div style={{"margin":"10px 10px"}}>Charging Devices</div>
                        <div style={{"margin":"10px 10px"}}>Connected Home</div>
                        <div style={{"margin":"10px 10px"}}>Device Care</div>
                        <div style={{"margin":"10px 10px"}}>Display & Graphic</div>
                        <div style={{"margin":"10px 10px"}}>Fitness & Sport</div>
                        <div style={{"margin":"10px 10px"}}>Headphones</div>
                        <div style={{"margin":"10px 10px"}}>HealthKit</div>
                        <div style={{"margin":"10px 10px"}}>Mice & Keyboards</div>
                        <div style={{"margin":"10px 10px"}}>Music Creation</div>
                        <div style={{"margin":"10px 10px"}}>Networking & Server</div>
                    </div>
                </div>
            </div>

View the output image here.

Answer №1

It appears that the problem lies with your use of

style={{ "maxHeight":"40vh",}}
. This seems to be causing your column to not have enough space, resulting in your elements being displayed in multiple columns.

Answer №2

Remember to include the overflow: auto; CSS property at the beginning of your code

<div className="bg-white d-flex flex-row flex-wrap justify-content-between border border-primary" style={{"width":"fit-content", "zIndex": "4", "borderTop": "#ffffff", "margin":"auto", "minHeight":"200px", "minWidth":"600px" }}>

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

Concealing the URL Once Links are Accessed

I have a Movie / TV Shows Streaming website and recently I've noticed visitors from other similar sites are coming to my site and copying my links. Is there a way to hide the links in the address bar to make it more difficult for them to access my con ...

Update the FontSize in the HTML dropdown menu using JavaScript

I am having trouble filling my Selection using a script. For example, when I try to populate my FontSizeMenu, I use the following code snippet: function FillFontSizeMenu() { FillSelection(GetPossibleFontSizes(), "fontSizeMenu"); } function GetPossib ...

Display logo when website has been scrolled

On my website, I want to display a logo in the header only when the site has been scrolled. I attempted to accomplish this with JavaScript: if(document.getElementById("div").scrollTop != 0){ document.write("<img src='logo.jpg'>"); } How ...

Using CSS to create a transition effect for fading in and out background images

I created a website with a captivating full-page background image (img/bg_start.jpg): If you hover your mouse over the central animal on the page, the current image (img/bg_start.jpg) will fade out and be replaced with another picture (img/bg_start2.jpg) ...

Engage in intricate animations on Blaze

Currently seeking an effective method for implementing animations within my app using Blaze. To provide further clarification, I have included a basic example below: <template name="global"> <h1>Hello everyone!</h1> {{> foo}} ...

verified that all form checkboxes were selected in angularJS

Hey there, I have a form in AngularJS with multiple checkboxes. When the first checkbox (Check All) is clicked, I want all the checkboxes to be checked. How can I achieve this using Angular for each field loop? Below is a snippet of my code: vm.asas = f ...

HTML element that does not contain any image attributes

Currently facing two issues, with the second one dependent on the resolution of the first. Everything was functioning correctly and looking fine until I came in to work on it today, only to find that the page is now broken. Interestingly enough, I am using ...

Is it possible to modify the breakpoint of the navbar in Bootstrap?

A similar question was posed here, but the proposed solution did not work due to issues with the JavaScript. The provided answer only addressed CSS changes, leaving the JS untouched, resulting in the content of the navigation bar being visible while the to ...

Tips on displaying email addresses on your website to prevent them from being spammed

Here is how I display email on my website: <a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7d14131b3d18051c100d1118531e1210">[email protected]</a>">Email</a> After analyzing my website ...

Unable to show an image within the <div> element when hovering the mouse

Is it necessary to use the background style image in order to display an image on mouseover of a name? I have implemented a controller and would like the image to be replaced by text within a div tag. Below is my HTML code: <!DOCTYPE html> <html& ...

Error with an Array of Objects in an Array when using Angular and Typescript

Our system has an array called "food/essen" with a total of 10 items. The food plan is made up of 8 objects from the "Food" array and includes an ID for the week number. An issue we are facing in our web application is that although it recognizes the 8 o ...

Styling AngularJS Pie Charts

Is it possible to customize the appearance of a pie chart created with angularjs-chart in order to achieve a design similar to this: https://i.sstatic.net/xYcu9.png While there are some examples available on the angularjs-chart website, one particular ex ...

Adjustable Text Size with HTML5 and CSS3

Looking to enhance the accessibility of a website by implementing text size adjustment buttons ' A A A ' using just HTML5 and CSS3. Avoiding the use of jQuery or Javascript for this task. Inspiration drawn from this link. Appreciate any assistan ...

Would it be acceptable to utilize Bootstrap rows as flex containers for their child divs, rather than employing columns?

Exploring the world of web development, I have delved into Bootstrap v4 for my personal projects. Following the grid system outlined in Bootstrap documentation, rows act as containers for columns. Interestingly, I found that Bootstrap rows are flex contain ...

Extracting information from a database (HTML, JavaScript)

I am currently working on a table that receives data from the server using ajax: $.each(data, function(i, item) { $('#MyTable tbody').append("<tr>" +"<td>" +data[i].A+ "</td><td>" +d ...

Is it possible for images to align vertically instead of horizontally in IE?

Encountering an issue with image alignment in Internet Explorer - they are aligning vertically instead of horizontally, while functioning correctly in all other browsers. Moreover, in IE8 and 7, the images are not being displayed at all. Is there a workaro ...

Save your canvas image as a file and attempt to force a download, only to be met with a failure to

Is there a way to save a canvas as an image file and allow users to choose the format (png or jpg) for download without saving the file on the server? Here's what I have tried: JavaScript Code: $.ajax( { type : "POST", url : "../php/downloa ...

Display a div element with sliding animation from the left side to the right

I am trying to create a slide-in effect on a div from left to right on my webpage, but it seems to be sliding in from right to left instead. I'm unsure of what the issue might be, can someone take a look and help me figure this out? $(document).rea ...

Using Testcafe to extract the value attribute of a hidden input element

Is there a way to retrieve the value of an <input>, especially what is contained within its value attribute even if the input is not visible? I am using testcafé, but it seems like this could be a challenge. Does anyone have any suggestions or opti ...

Counting the visible elements in Slick carousel

I have implemented slick.js to display a grid of 6 items (2 rows, 3 columns) per slide. I am looking for a way to include both the standard prev and next arrow navigation as well as an indication of the active item count for pagination assistance. For exa ...