The lack of responsiveness in the column flex-direction

Having an issue with the flex-direction: column property in responsive mode. When applying flex-direction: column to the .container, it does not behave responsively like flex-direction: row; instead, it overflows the layout. How can I resolve this?

   <div class="content">
     <div class="container">

       <div class="box">First Name Man</div>
              <div class="box">First Name Man</div>
       <div class="box">First Name Man</div>
       <div class="box">First Name Man</div>

     </div>
   </div>
.content {
  width: 100%;
  min-height: 800px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-wrap: wrap;
  background-color: whitesmoke;
}


.container {
  width: 100%;
  min-height: 500px;
   display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-wrap: wrap;

}

.box {
  width:700px;
  margin: 10px;
  color:white;
  min-height: 70px;

  display: flex;
  align-items: center;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

  justify-content: space-around;
  background-color: indigo;
  flex-direction: column;
  flex-wrap: wrap;
}

Answer №1

To ensure the correct display of .box with a width of 700px, adjust it to width: calc(100% - 20px) within a media query. This modification will allow it to function as intended by removing 20px for the left and right margins.

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

Getting images using index in Selenium

When it comes to extracting images from HTML, we usually rely on XPath, CSS selectors, or unique IDs. However, there are cases where images lack any distinguishable attributes. The structure of the HTML is as follows: <div id="altImages" class="a-fixed ...

Disorderly array refuses to remain inside designated div

My website features a JavaScript function that generates an array of varying size based on user input. I use the following code to display the output array, perArray, along with some additional text. document.getElementById("happyanswer").innerHTML= perA ...

Encountering a crash when trying to display HTML text in UITextView in Swift 4?

Recently, I implemented this code snippet: https://i.sstatic.net/fYCXQ.png var htmlToAttributedString: NSAttributedString? { guard let data = data(using: .utf8) else { return NSAttributedString() } do { return try NSAttributedString(data: ...

Using Angular and Typescript to create a dynamic text with the routerLink feature

Enhanced Question for Clarity: I am looking to dynamically display text and links retrieved from a service or database in an Angular HTML component. When the user clicks on these elements, I want it to programmatically navigate using Typescript's rou ...

Tips for creating a responsive image with a gradient overlay

Having trouble articulating my query, so here's a fiddle: https://jsfiddle.net/8zsqydj0/ .background-img-wrapper:before { content: ""; top: 0; left: 0; position: absolute; height: 100%; width: 100%; background: linear-gradient(to righ ...

Use flexbox to manage the width of containers and control the wrapping of elements

Hello, I am a newcomer to utilizing flexbox in CSS. I have these "boxes" that need to maintain their width and wrap when the screen size is small. On a large screen: https://i.sstatic.net/dXnGC.png On a small screen: https://i.sstatic.net/8rZso.pn ...

What could be causing the black background to appear when converting a Bitmap to a Base64 String in an Android web

I have been working on a code that combines two images into one using canvas. When I display the image in an ImageView, it looks fine. However, when I try to display it in a WebView, there is a black background appearing to the right of the image. I attemp ...

Transfer information from the client to the server using AJAX and PHP by

When attempting to post a JavaScript variable called posY to a PHP file, an error occurred with the message: Notice: Undefined index: data in C:\xampp\htdocs\Heads_in_the_clouds\submitposY.php The posY variable is defined in the JavaSc ...

Combining fixed pixel width with the max-width property in CSS

My container has a nested <p/> tag serving as the message text. The container is set to have a width of 200px, with a max-width of 600px to allow for expansion if the message length exceeds the initial 200px. However, despite these settings, the div ...

How to access and display nested JSON array items within an Angular 5 template

How can I display the value of line_donation from the meta_data array in this JSON data on my template? Here is the JSON data retrieved using ngFor: "line_items": [ { "id": 1003, "name": "Fresh Mango- 1 kg", ...

VSCode - when indenting, spaces are added around strings

Currently, I am utilizing Vue 3 along with Prettier in VS Code. One issue I am encountering is that when a string is on its own line, it is formatted correctly to my liking. However, the problem arises when my browser in Dev Tools renders strings with extr ...

retaining the scroll position of a window when refreshing a div

There's this issue that's been bothering me lately. I update the database via an ajax call, refresh the div, everything works fine, but it still scrolls to the top of the page. Here's what I have attempted: function postdislike(pid, user, ...

The container width is too wide for the swiper arrow to display properly

Errors encountered when displaying arrows over the width <Swiper slidesPerView={5} spaceBetween={20} pagination={{ clickable: true, }} ...

Combining multiple .php files in a single div

Hey there! I have a piece of code that allows me to load a PHP file into a div. It's currently functional, but I'm facing a challenge where I need to load the next file into the same div. <script type="text/javascript"> $(function() { ...

Personalizing navigation tabs using Bootstrap

I've been working on creating a custom bootstrap navbar tabs, but I'm struggling to remove the borders and apply the custom colors. After some trial and error, here's what I have so far: .nav-tabs, .nav-pills { text-align: center; bo ...

Unable to interpret JSON data in D3visualization

While attempting to read a JSON file using the D3 library, I encountered an issue where I received an alert indicating null values. Here is the code snippet I am using: <!doctype html> <html lang="en"> <head> <meta charset="utf-8" ...

Problem with user scalability in desktop browsers: when zooming out to 33% and lower, all CSS vanishes

Having trouble understanding why my styling disappears at 33% zoom on Chrome and even worse at 75% on IE11. <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"> <meta name="viewport" content="w ...

Arranging div elements in a dynamic container

I'm facing a challenge with structuring a new widget I'm developing. My goal is to incorporate a geographic map with hotspots without resorting to image maps. Here's the incomplete solution I've come up with so far: http://jsfiddle.ne ...

Create a Bootstrap div containing a button that adjusts to different screen sizes on the

Struggling with an issue in Bootstrap on how to create an input group with responsive content and a button on the right side. I want the button to always be on the right side and also responsive. I attempted to achieve this with the code below, but it does ...

The image spills out of its confines

Looking to create a dialogue box that fills the entire width and height of the screen? Want to divide its content into two sections - an image and a footer area with 2 rows of height? Struggling to contain the image within its designated space without over ...