Can you set a DIV to max width, so it stretches up to that?
Posted: Tue May 09, 2017 10:40 am
We want to have two divs side by side.
In the left DIV are a line up of divs containing products.
In the right div (float:left) we have a Buy Now button.
But sometimes the left div won't contain enough products to fill the screen, so there is a big gap between the left and right divs.
Can the left one just be given a CAP of a percentage. So that it only goes up to 85%, and the right one is fixed at 15%, but if there are only 3 products in the left DIV, the container will only go so far. A bit like using a TABLE and not giving it a width - it stretches to fit.
In the left DIV are a line up of divs containing products.
In the right div (float:left) we have a Buy Now button.
But sometimes the left div won't contain enough products to fill the screen, so there is a big gap between the left and right divs.
Can the left one just be given a CAP of a percentage. So that it only goes up to 85%, and the right one is fixed at 15%, but if there are only 3 products in the left DIV, the container will only go so far. A bit like using a TABLE and not giving it a width - it stretches to fit.