Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I have got a typical problem. I have three divs inside a div. The width is specified in rounded off percentages.

Values are
66.6666 --> 67%
16.6666 --> 17%
16.6666 --> 17%


Total comes up to 101%.

So last div does not fit into it. It comes down. I need to make three divs to be in same base line(horizontally).

How do I solve this issue?
Posted
Comments
Thanks7872 30-May-14 9:47am    
Title of the question has nothing to do with content. Further, adjust percentage your way. Whats the issue?

1 solution

The trick is not to use percentage for the last figure ... set it as follows
lastwidth = 100 - 67 - 17

OR
Make sure you always round down, or truncate, the calculated valuse
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900