4 ms·
Hi I'm an author of this framework. I must point that this is just experimental framework it works only in Firefox4 and later. Back in 2008 I build Malo - CSS
by vladocar 15y ago
Hi I'm an author of this framework. I must point that this is just experimental framework it works only in Firefox4 and later.
Back in 2008 I build Malo - CSS Framework http://code.google.com/p/malo/ http://code.google.com/p/malo/ that already is using the solution that you pointed (div inside div). Malo works even in IE 5.5.
The problem of this solution is that you have extra divs or paragraphs or you mast build complete typographical solution like I did with Emastic http://code.google.com/p/emastic/ http://code.google.com/p/emastic/.
Other solution is to have % margins(gutter) Example: width:24% and margin-left:1% total 25%. This is good solution if you have fixed container like 960px or 1000px.
So if we have 1000px container is very easy yo calculate that 1% will be 10px.
But what happens if we want to have 80% container? Meaning 80% of any browser size. There is no way that we can calculate that. That is calc() is cool.
We can do calc(25% -10px) margin-left:10px
Here is working demo: http://dl.dropbox.com/u/2111778/Foxy-CSS-Framework/calc1.html http://dl.dropbox.com/u/2111778/Foxy-CSS-Framework/calc1.htm... .
The concept is: Fluid % main container (it can be also fixed), fluid % columns, fixed px margin(gutter).
I repeat this is just experimental framework with the goal to show potential use of the CSS3 calc() function. I think that the calc() function has huge potential for cool layouts in the future..
- pornel 15y agoAre you aware that you can achieve visually identical effect with `box-sizing`? (it can change "W3C" box model to "quirks" box model on any container) width: 25%; padding: 10px; border: 5px; box-sizing:border-box; gives same effect as: width: calc(25%-10px-5px); padding: 10px; border: 5px; Also, it would be nice if your framework had at least half-decent fallback for browsers without calc() (I think `width:24%` would be better than leaving it auto).
- netghost 15y agoFor anyone interested, I actually had written up an article on box-sizing yesterday: http://monkeyandcrow.com/blog/splitting_the_difference/ http://monkeyandcrow.com/blog/splitting_the_difference/ There's an example illustrating pornel's point.
- vladocar 15y agoI actually wanted to use margins, yes is true if you use padding the box model can help, here is good explanation about the http://www.quirksmode.org/css/box.html http://www.quirksmode.org/css/box.html box model.