Live data from Hacker News

* { box-sizing: border-box } FTW

paulirish.com

41–50 of 90 posts

Re: * { box-sizing: border-box } FTW

#41

Where the traditional box model starts to make sense is with fixed-size elements, such as images. Adding padding to an element shouldn't alter the dimensions of the contents within the element.

Yes it should. If you don't want that space to be from within the element, then you should be setting a margin, not a padding.

Box analogy: when you add foam padding to a box to protect its content, are you effectively widening the box or reducing the volume it can fit?

Re: * { box-sizing: border-box } FTW

#44
post #21

Earlier quoted context omitted.

The article explains that in full (everying apart from <=ie7)

Could you not just trigger quirks mode in IE6 and IE7 to get the old box model, or is border-box different to the old microsoft box model?

The old microsoft box model was basically this one, but the implementation was so full of bugs that it ended up being "test and change until it shows the way you want".

There are even lists compiling those bugs, such as http://www.positioniseverything.net/explorer.html

Re: * { box-sizing: border-box } FTW

#45
post #31

I can't tell you how much I enjoyed doodling in the margins while I read that article.

What article? doodling

I don't know what I did, but after I doodled a bit and scrolled the page around using the middle mouse button, this youtube video popped up over the page: http://www.youtube.com/watch?v=E6x_-xKl-Fg

Also the konami code makes the same sort of unicorns appear that were on the video.

Re: * { box-sizing: border-box } FTW

#46
Was I the only one that for some reason got a Youtube-video that all of a sudden popped up and started playing a short video about ESPN being hacked or something?

Might have been a glitch of some sort, but I'd suggest OP should check his source code to see if he hasn't been compromised of some sort.

Re: * { box-sizing: border-box } FTW

#47
post #46

Was I the only one that for some reason got a Youtube-video that all of a sudden popped up and started playing a short video about ESPN being hacked or something? Might have been a glitch of some sort, but I'd suggest OP should check his source code to see if he hasn't been compromised of some sort.

omg hacked! Nah it's cool. I wired that up. The unicorns konami trigger that was featured in the video was introduced by my blog so it's a bit of an homage or something. Thxthx.

Re: * { box-sizing: border-box } FTW

#50
post #48

Because I know we all wanted it. http://jsfiddle.net/gSD94/2/ http://jsfiddle.net/gSD94/2/embedded/result/ (great article too!) edit: better link (fullscreen!)

Nice work. I talked about the effect back at http://paulirish.com/2010/my-harmonious-background-canvas/

And the equivalent code is available on Github: https://github.com/paulirish/harmony

Post reply on HN