How to remember in CSS that margin is outside the border, and padding inside

I don't edit CSS very often, and almost every time I need to go and google the CSS box model to check whether padding is inside the border and margin outside, or vice versa. (Just checked again and padding is inside).

Does anyone have a good way of remembering this? A little mnemonic, a good explanation as to why the names are that way round ...


When working with CSS finally drives you mad the padded cell that they will put you in has the padding on the inside of the walls.

Need Your Help

having trouble with password encryption, no errors?

php security encryption hash bcrypt

Following this tutorial: i've been trying to implement encryption for passwords in my registration form. At the moment the code I have...

Passing ListBox as a function paramaeter in C++

c++ winforms function listbox

I wonder if there's any way to pass the whole ListBox object to function as a parameter? Well, basically I only need listbox's selected index propertie, so I easily went around this by saving it's ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.