What is the best way to display X plus one-third of images on a dynamic layout?

Example: http://jsfiddle.net/AtbFR/2.

I'm currently working on a dynamic liquid layout that consists of two columns on either side. The main container is set to 100% width with margins for padding, creating a flexible design inside the columns.

When resizing the browser window, more images are displayed as the width increases. However, I need to make a slight adjustment. Instead of always showing a variable 'X' number of images, I want it to display X + (1/3) images. For instance, in a very large window, it should show 10 full-width images and only 1/3 of the last image.

#list {
  width:80%;
  border:1px solid black;
  margin: 0 auto;
}
#list ul {
  height:40px;
   overflow:hidden;
}

#list ul li {
  display:inline;
}

Answer №1

Consider adding a min-width to the ul element and applying overflow:hidden to the #list container.

http://example.com/jsfiddle123/

#list {
  width:70%;
  border:1px solid gray;
  margin: 0 auto;
  overflow:hidden;
}
#list ul {
  height:30px;
  min-width:100px;
  overflow:hidden;
}

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

an li element is accompanied by a visible box

In my possession is a container: #box1 { height:100px; width:208px; } along with a series <li id="first"><strong>FIRST</strong> </li> <li id="second"><strong>SECOND</strong&g ...

Utilize/Absolve/Add a Prefix to angular material scss styles

Issue I am facing a challenge with integrating angular material SCSS into my application. I want to ensure that these styles are isolated and scoped specifically for my application, as it will be embedded within a larger monolith. The goal is to prevent a ...

Adding animation effects using CSS and/or jQuery

Are there any Jquery plugins or CSS codes available to achieve similar effects as seen on the following pages and , without utilizing webGL?... ...

What is the best way to position two divs side by side in a way that maximizes the available space?

I am facing an issue with two divs in my HTML code. The right one is set to 80px wide while the other should fill up the remaining space. I have tried various CSS configurations but it seems that the right box always ends up below the left box instead of b ...

Div being visually overtaken by background image

I am struggling to make the image declared in bg fit into the container-fluid without overflowing. You can check out the live example at . The main objective is to position the text on top of the image so that I can apply opacity and blur effects to the i ...

Error: Image size must be larger

While working on designing cards in cakephp, I encountered an issue when trying to display images wider than 600px - they extended beyond control! Oddly enough, using placeholder or dummy images doesn't cause any problems. Why is this happening? How ...

Set a CSS rule to style every other row in a table, starting from the second row and resetting after

Is there a way to refresh the even and odd count in CSS whenever a specific row is shown? Here's an example setup: header header header even even even odd odd odd Subhead Subhead Subhead even even even How can I ensu ...

Ways to create a flexbox that can scroll and includes two divs that fill the entire screen

I need to create a flexbox layout with two divs that split the screen evenly. However, I want the flexbox to change direction from row to column and make each div full width and height of the screen when the viewport is smaller than 800px, creating a scrol ...

Halt animation instantly using jQuery

Is there a way to permanently stop an animation on a webpage that is triggered every second? I have a button labeled "Stop" but when clicked, the animation stops momentarily before continuing. Is there another method to completely remove the animation? You ...

The CSS class fails to run when added in a JS file

I have just started learning CSS and JS, and despite reviewing my code multiple times, consulting w3schools, and searching for similar issues, I am still unable to pinpoint where the error lies. <! DOC TYPE HTML> <html> <head> <h1 ...

What is the recommended way to handle passing props to child components in React - should all props be passed down, or only specific props

When it comes to passing props to child components, which approach is more efficient: Method 1. Utilize {...props} to pass all props, for example: ParentComponent = (props) => { return <ChildComponent {...props}> } Method 2. Explicitly pa ...

Shift designated list item to the right with overflow handling

A current project involves working on a sidebar created in bootstrap, and I've encountered an issue. I can't seem to move a selected item to the right and have it flow over the nav div. I attempted to increase the z-index with no success. One su ...

An unusual CSS phenomenon with z-index

I've encountered a peculiar issue with my z-indexing. I have an image positioned relatively with a z-index of 1, and it should be above my navigation that is positioned absolutely with a z-index of -1. The problem is that upon page load, the image ap ...

"Tailwind - where your brand shines with a sleek, modern logo that stands

I have a specific title width that I need to adhere to, and I'm looking to place a logo after the last word in the title. When the title is too lengthy, it wraps onto a second line. For example: My Title (insert logo here) Check out this CodePen us ...

What is the best way to specify which section should be printed when the user selects the print option on my website?

My webpage consists of headers and a side menu with the main content area displayed on the right. I want users to be able to print only the contents of the main content area when they click print or use CTRL+P, without relying on jQuery for this functiona ...

I am looking to use flexbox and Vue.js to organize my sent messages in blue on the right and received messages in yellow on the left. How can I achieve this grouping effectively?

I've successfully built a messenger system using Vue.js with a Laravel backend. My goal is to display messages from myself (Jim, the logged in user) on the right side in blue and messages from Debbie (the recipient) on the left side in yellow, similar ...

External CSS stylesheets fail to function properly in the presence of the Bootstrap framework

I'm experiencing an issue where my external stylesheet isn't being compiled when I include bootstrap. Strangely, it works fine with internal and inline stylesheets. However, when I switch to Firefox browser, it works perfectly. What could be caus ...

The HTML code is failing to detect the eventListeners

Does anyone know why my JavaScript event listener is not working when I try to link it to my HTML? They are in separate text documents, but I'm not sure if that's the issue. It seems to work with other sections, so there might be a small mistake ...

Responsive components become concealed if there is limited space available

I'm struggling with figuring out what to write exactly. I have 4 boxes each with a width of 300px. If the document width is around 600px, then only 2 boxes should remain visible on the page while the others are hidden. Is there a way to make this dyn ...

Display issues with CSS Absolute Positioning in IE11

I have encountered an issue with my html and css code that uses absolute positioning. While it functions correctly on Chrome and Firefox, I am facing a problem with Internet Explorer. The absolute position property in the SVG class does not seem to work in ...