PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue May 23, 2017 3:46 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue May 09, 2017 10:40 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4196
Location: United Kingdom
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.

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Wed May 10, 2017 5:32 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6243
Location: Montreal, Canada
Do you mean something like this? https://codepen.io/anon/pen/vmdpdV

Play with the number of child divs on the left to see what I mean.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Wed May 10, 2017 6:31 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4196
Location: United Kingdom
No. The way you have done it there, there three DIVs on the left, would stretch. So if images were in there, they would all be stretch as at 100% each.

I want the inner divs to be set to 6 across, but not to stretch to fill that left column.
So let's say I have a Bundle with 3 products, and a Bundle with 10 products.
The left column contains the tiled DIVs. the right column has the Buy Now button.
If the first Bundle (3) is not wide enough to fill the screen, then that outer div should not be stretched out as there isn't enough inside it's DIV to push it out.

But Bundle (10) does, in fact it's inner DIVs would tiled to a second row, but the Buy Now div would still be at the top over on the far right, as it's products are pushing it out to the max width of 85%.

Make sense?

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Wed May 10, 2017 10:37 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4196
Location: United Kingdom
Having a fresh think about this. It wouldnt' work. If the DIVs containing the product photos are set to 14%, with the image set to 100%, it will be 14%/100% of the parent DIV - the one I want to be smaller or larger, depending on the amount in it's DIV.

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group