Older browser compatibility for Flexbox flex-flow alternative

<template>
  <div>
    <h2>Kanal Listesi</h2>
    <div class="container">
      <div v-for="(channel,index) in channels" :key="index">
        <div v-if="channel.ChName">
          <img
            :src="'http://uyanik.tv/conf/images/'+channel.Image"
            :class="{selectedIndex:currentIndex === index}"
            :ref="index"
          />
        </div>
      </div>
    </div>
  </div>
</template>

.container {
  display: flex;
  flex-flow: row wrap;
}

.container::after {
  content: "";
  flex: 0 1 32.7%;
}
div > div > div > div > img{
  margin: 10px 10px 10px 10px;
  height: 100px;
}
div{
  text-align: center;
}

Utilizing flexbox in the container element of my VueJs application helps to rearrange misfitting boxes into the next rows. However, due to compatibility issues with older browser versions on TVs, I am unable to fully utilize the flex-flow property. This results in items overflowing off the screen. The desired output should resemble the image below:

https://i.sstatic.net/9PkHw.jpg

Unfortunately, the actual output on the device is different:

https://i.sstatic.net/iJ9l4.jpg

Answer №1

If you want to achieve this desired layout, you can utilize either float or inline-block. Take a look at the example below:

div {
  width:100%;
  padding:0 15px;
}

div img {
  float:left;
  margin:10px;
}
<div>
  <img src="http://placehold.it/100x100" />
  <img src="http://placehold.it/100x100" />
  <img src="http://placehold.it/100x100" />
  <img src="http://placehold.it/100x100" />
  <img src="http://placehold.it/100x100" />
  <img src="http://placehold.it/100x100" />
  <img src="http://placehold.it/100x100" />
  <img src="http://placehold.it/100x100" />
  <img src="http://placehold.it/100x100" />
  <img src="http://placehold.it/100x100" />
</div>

JSFiddle

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

Customizing #app CSS with Vuetify for development and production environments

After developing my app using vuetify and vue cli, everything was running smoothly in the development environment. However, upon running npm run build, a new default #app CSS was generated and it ended up overriding my custom CSS in the final bundled file. ...

Ways to extract data from an array nested within a JSON object

I am seeking guidance on how to access the value of "result 2" from my JSON object using jQuery or pure JavaScript. var jsonarray = [{ title: "Category1", items: [{ result: "Item1", //Nested array items2: [{ //How to get the value o ...

Enhance Summernote functionality by creating a custom button that can access and utilize

Using summernote in my Angular project, I am looking to create a custom button that can pass a list as a parameter. I want to have something like 'testBtn': this.customButton(context, listHit) in my custom button function, but I am unsure how to ...

The current HTML scraping results are showing a variation in numbers

I recently created a code to extract the price of a mutual fund into an excel sheet using VBA. It was working perfectly fine until last night when it suddenly started pulling in a different number, specifically the % return on the Dow at the top of the pag ...

Using the ternary operator for filtering in GraphQL

Is it possible to use the ternary operator within a GraphQL filter? I am attempting to filter based on a variable but encountering an error GraphQLError: Syntax Error: Expected Name, found "=". query GetQuery($env: String) { category (filte ...

When adjusting styles using Chrome DevTools with Webpack HMR, the page layout can become distorted

Encountering a peculiar issue: Currently utilizing Webpack in conjunction with Vue-CLI and HMR. On attempting to modify styles via DevTools in the browser, the page itself undergoes unexpected changes - some styles are removed (screenshots provided below) ...

Activate the display by utilizing the getElementsByClassName method

In my design, I'd like to have the "Don't have an account?" line trigger the display of the .registrybox class when clicked. However, the script I've written doesn't seem to be working as intended. The script is meant to hide the .login ...

Choose the list item by identifying the corresponding unordered list

Is there a way to target the second li element within an ul list like this: HTML <ul> <li></li> <ul> <li>This one is what I need to select</li> </ul> </ul> ...

Boost the font size on Bootstrap UI Angular timepicker for a better user experience

Is there a way to adjust the font size and width of the timepicker control in Bootstrap UI Angular? Specifically, I am looking to make the text larger and increase the size of the Chevron (up/down buttons). Here is the code snippet I currently have: < ...

What causes isomorphic-style-loader to generate a TypeError: Cannot read property 'apply' of undefined when utilized alongside CSS-Modules?

Currently, I am working on server-side rendering the application, and while the HTML and JS are loading fine, I have encountered an issue with my styles (.less | .scss) not being loaded. After some research, I believe that the problem lies in missing the i ...

How can the total price for a shopping cart be computed in React/Redux?

After extensive searches on Google and SO, I'm still coming up empty-handed when it comes to calculating the total price of items in a cart. Many tutorials stop at basic cart functionalities like "Add item to cart" or "increase/decrease quantity", but ...

The best practices for integrating Firebase with REST APIs

While searching for a tutorial on integrating REST APIs with Firebase, I came across numerous code snippets utilizing the curl method calls or other helper libraries. However, what I couldn't find were the basics - such as where to call these methods ...

To prevent flickering when using child flex elements, it's best to use position fixed along with a dynamically updated scrollbar position using Javascript

My navigation component includes a slim banner that should hide upon scroll and a main-nav bar that should stick to the top of the screen and shrink when it does so. I initially looked into using Intersection Observer based on a popular answer found here: ...

Could someone assist me in identifying the error or mistake?

For my project, I have implemented client and server sign-in & sign-up functionalities. However, after fetching the register API from the frontend, it is displaying an error message "please fill all fields" even though I have provided validation for al ...

How to Make a Zigzag Formation in three.js?

I have been working on developing a 3D tool and was in need of a zigzag structure. I managed to create it by iterating a function that produces 'V' multiple times, but now I am looking for a way to achieve the same effect using a single geometry ...

Acquiring information from the parent component upon refreshing a route using Vue and Vue Router

I am currently working on a component that displays multiple routes (Step1, Step2, Step3...) consecutively. I am navigating and passing properties like this: <router-view @next-button-step1=" $router.push({ name: 'Step2', ...

The equivalent of the $.curCSS method in jQuery version 1.10 is as follows:

While working with a library called mcdropdown from http://www.givainc.com/labs/, I encountered an issue with the $.curCSS method. The latest version of jQuery no longer supports this method and suggests using $().css instead. Following the documentation, ...

Attempting to employ the .reduce method on an object

Currently, I am faced with the task of summing a nested value for all objects within an object. The structure of my object is as follows: const json = [ { "other_sum": "1", "summary": { "calculations" ...

Implementing a blur effect on a CSS loader

I have successfully implemented a loader feature where a loading animation is displayed upon clicking the submit button, indicating that the form submission is in progress. However, I am encountering an issue when trying to apply a blur effect to the entir ...

JsDoc presents the complete code instead of the commented block

I have a VUE.JS application that needs to be documented. For .VUE components, we are using Vuese. However, when it comes to regular JS files like modules, we decided to use JsDoc. I have installed JsDoc and everything seems fine, but when I generate the HT ...