Exploring Flexbox Grid on Safari and Chrome

I have encountered an issue while trying to implement a grid using flexbox and sass. It seems to be functioning smoothly on Chrome, but I am facing some problems with Safari. The red boxes are "overflowed" and do not break to a new line as expected.

An important observation is that the grid works fine in Safari when the browser window is smaller than the screen resolution.

To troubleshoot this issue, it might be beneficial to create a new HTML file specifically for testing the problem and compare the results between Safari and Chrome.

Safari (horizontal overflow, requiring scrolling)

https://i.sstatic.net/JnZY7.png

Chrome

https://i.sstatic.net/OPE3v.png

<style>
    .flex-parent {
      display: flex;
      display: -webkit-flex;
      flex-direction: row;
      -webkit-flex-direction: row;
      flex-wrap: wrap;
      -webkit-flex-wrap: wrap;
      justify-content: flex-start;
      -webkit-justify-content: flex-start;
      margin-left: -14px;
      margin-top: -14px;
      margin-bottom: 14px;
    }
    .flex-parent .event_card {
      flex: 1 0 345px;
      -webkit-flex: 1 0 345px;
      margin-left: 14px;
      margin-top: 14px;
      padding: 14px;
      box-sizing: border-box;
      height: 140px;
      background: red;
    }
    @media (min-width: 690px) {
      .flex-parent .event_card {
        max-width: calc( 50% - 14px);
      }
    }
    @media (min-width: 1035px) {
      .flex-parent .event_card {
        max-width: calc( 33.33333333% - 14px);
      }
    }
    @media (min-width: 1035px) {
      .flex-parent .event_card {
        min-width: calc(33.33333333% - 14px);
      }
    }

</style>
    <html>
    <body>
    <div id="content">
        <div class="flex-parent feedify-item-body">
                    
            <div class="event_card">
                <div class="wrapper Aligner">
                    <div class="card__front"></div>
                </div>
            </div>

            <div class="event_card">
                <div class="wrapper Aligner">
                    <div class="card__front"></div>
                </div>
            </div>

            <div class="event_card">
                <div class="wrapper Aligner">
                    <div class="card__front"></div>
                </div>
            </div>

            <div class="event_card">
                <div class="wrapper Aligner">
                    <div class="card__front"></div>
                </div>
            </div>

             <div class="event_card">
                <div class="wrapper Aligner">
                    <div class="card__front"></div>
                </div>
            </div>

             <div class="event_card">
                <div class="wrapper Aligner">
                    <div class="card__front"></div>
                </div>
            </div>

             <div class="event_card">
                <div class="wrapper Aligner">
                    <div class="card__front"></div>
                </div>
            </div>

        </div>
    </div>
    </body>
    </html>

If you could provide some insights into what may be causing this issue and suggest possible solutions, I would greatly appreciate it.

Thank you

Answer №1

It appeared that the issue was connected to

flex: 1 0 345px;
-webkit-flex: 1 0 345px;

I decided to modify it to

flex: 1 0 calc( 33.33333333% - 14px);
-webkit-flex: calc( 33.33333333% - 14px);

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

I'm currently experiencing a challenge with a project I'm tackling that specifically deals with chart.js

In my recent coding project, I created a script to gather user input and then present it in various chart formats. However, upon executing the code, the selected chart fails to display after inputting values and clicking on the "generate chart" button. Her ...

determining CSS selector

Having trouble identifying a locator using CSS. There are 10 elements with the same locator name on the webpage. Each web element has the same XPath value: //div[@class='thumb_image'] The web element list size is 10. If I want to access the 5t ...

Is it possible to extract a div from a third-party domain and showcase it on my website?

Trying to integrate content from my Veetle.com channel onto my personal website has proven to be quite the challenge. Initially, I attempted to modify an iframe with CSS to display only the schedule information, but encountered limitations due to using 3rd ...

Interactive horizontal web design with center alignment and dynamic scrolling feature

We have designed a unique web layout that is centered horizontally and includes an animated scrolling effect. There are 5 menu options that use simple anchor links to navigate between different pages. Our layout features static content with only the body s ...

Position an image in the center and add a div below it

I am seeking guidance regarding two specific questions. My objective is to showcase an image in its true size while positioning it at the horizontal center of the screen (not the exact center), followed by a div containing text directly underneath the imag ...

Overlaying div above vimeo player

I'm attempting to overlay a div on top of a Vimeo video, a task I anticipated would be straightforward but turns out to be more complex than expected. Below is the HTML code snippet: <div id="wrap"> <iframe id="video" s ...

Achieving Vertical Alignment of Content in Bootstrap 5

I've experimented with different approaches based on search results, StackOverflow suggestions, and examining existing code snippets. Here is the snippet of code I am working with: <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a ...

What is the proper class name for the element to function correctly?

Here is a snippet of the Next.js code I am working on: import ReactMarkdown from 'react-markdown' import gfm from 'remark-gfm' import styles from './content.module.css' return ( <article className={styles.markdownbody}&g ...

Tips for keeping a video background stationary while allowing the text to move smoothly

When I added the video for the background, it only appears at the top of the page. However, I want it to be visible as the rest of the page is scrolled. <div class="hero"> <video autoplay loop muted plays-inline class="back-video&qu ...

What is the correct CSS2 selector syntax to apply the :hover effect to the nth child of a specific element?

My goal is to apply a unique background color to each menu li element when hovered over, and I want to accomplish this using CSS2. <ul> <li> <li> <li> <li> </ul> I managed to add a background color to t ...

What is the best way to implement a dropdown menu with JavaScript or jQuery?

I'm looking to create a dynamic dropdown list using Javascript or JQuery that mirrors the functionality of selecting countries, states, and cities. Can someone provide guidance on the best code to achieve this? Below is a snippet of my existing code: ...

Navigating to the following webpage with Selenium using Python

url_main = "https://comic.naver.com/webtoon/detail.nhn?titleId=131385&no=292" This particular website features a comment pagination at the bottom of the page. Upon inspecting the page, I noticed that the buttons were structured like this: &l ...

The carousel image slider seamlessly transitioning from the second image

I'm having an issue with the Carousel slider where it is overlapping the image from the second slide onwards. The first image loads properly, but subsequent images are not displaying correctly. Here's a reference image: https://i.sstatic.net/pyY ...

Error encountered while trying to load the fonts

Upon attempting to load fonts into the Spectacle boilerplate, I encountered the following error message: Failed to decode downloaded font: http://localhost:3000/assets/fonts/Overpass-Bold.ttf OTS parsing error: invalid version tag I've includ ...

What is the reason behind LESS displaying arithmetic operations as text instead of performing them?

Whilst composing the subsequent operations @a: 2px @variable: @a + 5; .margin-style{ margin-left: @variable; } The code above compiles into .margin-style{ margin-left: 2px + 5; } Rather than margin-left:7px; What could be causing this issue? ...

Exchanging text between varying divs and classes

On my webpage, I have multiple boxes of cards where content can dynamically populate. Each box contains a click-to-open accordion feature in the upper right corner. I am struggling to figure out how to change the text of only the clicked box without affect ...

Is there a way to automatically clear the text field value after submitting?

Greetings everyone, I'm looking for guidance on removing the text field content once I click submit. I have a button labeled "senden" and my goal is to clear the text fields and uncheck the checkbox after clicking this button. I've attempted se ...

Rebel Spirit on a Wordpress Platform

I've encountered a strange issue on my Wordpress blog. For some reason, the code "&nbsp" is being inserted right after the opening <body> tag. I have checked the header.php file and there is no instance of this code present there. It's ...

Once more baffled by the nested boxes, this iteration adorned in vibrant hues and trimmed with a striking border

In a previous inquiry, I sought advice on centering one box within another. However, my attempts this time around have led to some peculiar results. I experimented with two different code variations- one involving a background color and the other utilizing ...

Looking to ensure that the blockquote element is placed on its own separate line?

We are attempting to ensure that our blockquote element appears on a separate line. Despite trying both clear:both and display:block CSS properties, we have not noticed any changes. Our target browsers are IE7 and Firefox 3. Any assistance would be great ...