html - How to keep symmetry with CSS fluid spacing of dynamic content -
I have a main content in which I'm dynamically adding content blocks to a row-style layout (tables has no use) . I am trying to keep a space symmetry between the content block as well as the range of content blocks and the range of the main content.
This is the layout I am trying to achieve:
______________________________________ | | | | Xxxxx | | Xxxxx | | Xxxxx | | Xxxxx | | | | Xxxxx | | Xxxxx | | Xxxxx | | Xxxxx | | | | | | Xxxxx | | Xxxxx | | Xxxxx | | Xxxxx | | | | Xxxxx | | Xxxxx | | Xxxxx | | Xxxxx | | | | | | Xxxxx | | Xxxxx | | Xxxxx | | Xxxxx | | | | Xxxxx | | Xxxxx | | Xxxxx | | Xxxxx | | | ______________________________________ | The large container div is my content div
small | XXXXXX | Blocks are my internal content-block divs
Here's the issue I raise: When I use the inner space from margin-left or margin-right to the right place, then with this large content devil Throwing the edge of the block in the edge - then I end up with the extra space, either far or far to the far left which looks ugly on the page. I have set the width of the inner blocks to allow 4 rupees "row" which I want to keep the layout. The total number of internal blocks is dynamically determined by data from 1 to 30 anywhere in my DB. Here's my code:
div.content {float: left; Width: 96%; Padding: 2%; } Div.inner_block {float: left; Width: 22%; Height: 150px; Margin: 0% 3% 2%; } If possible, I would like to keep the "padding: 2%" on the content div as it will maintain consistency in many other pages loaded into this content device.
What do you think? What is the solution?
Thank you!
2% be 2% Well everything balances.
Comments
Post a Comment