Andy Budd on CSS Margin Collapsing

Margin-collapsing can sometimes be tricky to CSS beginners; especially as modern browsers support CSS better, collapsing margins is something that you could easily run into. However, Andy Budd has written an extended blog entry on the workings behind collapsing margins.

For the most part, margin collapsing has few rules:

At its core, margin collapsing is very easy to understand. Basically when two vertical margins meet up, instead of adding together, the largest margin takes precedent and the other one “collapses” to nothing. […]

For example, if you have two adjacent paragraphs, the first with a 20px bottom margin and the second with a 15px top margin, the space between them will only be 20px — since the smaller of the two margins (15px) collapses into the larger one (20px).

It can get a bit tricky when borders come into play. In the case of borders, the two elements’ margins are no longer directly touching and so the margins don’t collapse. I’ve run into that one a few times when I’ve turned on borders on an element (for debugging) and then found the layout to be wildly different after I finished debugging and turned off the borders.

The article also goes on to talk about how margins collapse around floated elements. But, most beginners who would run into collapsing margins may not be using floats as a layout technique anyhow. In all, I found the article informative and I won’t hesitate to refer to it if I run into some weird collapsing issues.

Dijon, You’re All Right With Me

Back when I learned of Good Eats’ grilled cheese recipe, I wasn’t terribly enthused about the Dijon mustard called for in the recipe. Really, I haven’t liked Dijon mustard for some time. But, after thinking it over, I realized that maybe it was just me — maybe it was just the particular Dijon that I had been exposed to over the years.

Growing up, my parents enjoyed Grey Poupon with various dishes. And, I tried it several times over the years but didn’t quite like it. But, after seeing Dijon mustard used by so many television chefs, I got to thinking that maybe I should give Dijon another chance. And, I also came to realize that Grey Poupon isn’t the “gourmet French mustard” that it pretended to be — it’s made by Kraft!

So, the next time the grilled cheese episode of Good Eats aired, I paid special attention to the mustard that Alton used (I trust his views on food, after all). I didn’t get that good a look, but I noticed its black label and made a mental note of the jar’s approximate size.

Next time I visited Target, I strolled down their mustard aisle to see what I could find. Sure enough, I found a couple likely candidates from Maille. Their labels are black and their jars looked about right size. There were two varieties: original Dijon and wholegrain. Figuring that the wholegrain version might have more Dijon essence, I decided to go for that one. And, besides, at $2.50, it wasn’t a big investment in case it turned out that I didn’t like it.

That evening, I prepared my tuna sandwiches for the following day (typically, I would have a tuna sandwich for breakfast and lunch, though I’ve been having omelettes for breakfast recently). And, I decided to give the new Maille Wholegrain Dijon a try. So, I slathered on a layer to each of the sandwiches. I prepared the tuna and completed the sandwiches.

Though I made the Dijon-tuna sandwiches last night, I only had a chance to try one today. And, to my pleasant surprise, it was rather tasty. There wasn’t any of that weird Grey Poupon-esque aftertaste and the Maille Dijon was also more flavorful (yet somehow more subtle) than the brown mustards I was used to. As an unexpected bonus, the wholegrain nature of the mustard also created little “flavor pockets” of mustard that burst in each bite.

I’m guessing that Grey Poupon may still not be my cup of tea, but I’m satisfied with my $2.50 investment into Maille. Perhaps I’ll even try the original Dijon next time, just to see how its flavor profile compares to the wholegrain.

Gina’s Chocolate-Tar Squares

Roger threw a housewarming party on Saturday — it was a lot of fun and there was plenty of food & beverages. In particular, Gina made what she called “chocolate-tar squares”. From what she tells me, she initially thought about making some brownies but then realized that she didn’t have the necessary accessories to the brownie mix (an egg, oil and so on).

So, she instead decided to make some brownie-shaped bars out of packaged cookie dough. I can only guess that she already had the cookie dough on hand since, if she were going to the store for it, she could have just as easily bought some eggs and oil while she was there ;). In any case, in a moment of recipe freestyling, Gina decided on the tar squares.

Simply, she placed the cookie dough across the bottom of a standard 8x8 pan — it was if she was making brownies, only not really. She baked them for the recommended 15 minutes or so, but found that they were still uncooked after that time. Since she had taken them out of the oven anyway (to test their doneness), she drizzled on some caramel before returning them to the oven (hey, why not?).

Apparently, these pseudo-brownies took almost a hour to cook through. Perhaps when sized into cookies, the dough is heated from all sides and bakes faster that way (?). After cooking, Gina sliced the chocolate-tar into squares for serving. All of this baking & preparation is from what Gina told me — I can only speak first-hand on the eating part ;).

As you may have already guessed, the caramel didn’t really form a layer on top of the squares but rather infused itself into them. And, as the dough is chewy to begin with, Gina coined the “tar” moniker. Perhaps “chocolate goo squares” or even “chocolate chewy squares” would have also worked.

As I can’t resist homemade treats, I soon tried one of the chocolate-tar squares. Sure enough, it was both chewy and square. And, the caramel made for a pleasant sidekick to the chocolate chips. In all, they were very tasty, especially considering that the recipe didn’t exist before that evening.

Being the chocolate aficionado that I am, I wonder if they could be made even better with a layer of chopped dark chocolate to accompany the caramel layer. Or, the chopped chocolate could be substituted for the caramel for an even-chocolatier treat. Perhaps some day I’ll have to give that a try.

Bruce Schneier on the Security of ID Checks

Bruce Schneier is a cryptographer and the founder & CTO of Counterpane Internet Security. I came to know about him from one his earlier books, Applied Cryptography (I had an interest in cryptography at the time and I still do). In any case, I respect his viewpoints on security and cryptography.

I recently found an article written by Schneier for the San Francisco Chronicle on the false sense of security that ID cards can provide. I’ve never particularly felt an extra sense of security from having my ID checked all the time (airports and elsewhere) and Schneier put into words some reasoning behind that:

First, verifying that someone has a photo ID is a completely useless security measure. All the Sept. 11 terrorists had photo IDs. Some of the IDs were real. Some were fake. Some were real IDs in fake names, bought from a crooked DMV employee in Virginia for $1,000 each. Fake driver's licenses for all 50 states, good enough to fool anyone who isn’t paying close attention, are available on the Internet. Or if you don’t want to buy IDs online, just ask any teenager where to get a fake ID.

Harder-to-forge IDs only help marginally, because the problem is not making sure the ID is valid. This is the second myth of ID checks: that identification combined with profiling can be an indicator of intention. […]

In short, checking IDs doesn’t help much since they could be forged. And, even if an ID is too difficult to forge, confirming an identity doesn't automatically stop crimes — even if IDs are checked against a list of known “bad guys”, the Bad Organizations could still recruit minions that aren’t yet on any Bad Lists. Schneier’s reasoning makes sense to me, but something tells me we won’t be doing away with ID checks at airports any time soon ;).

Picard Doesn’t Like Space Travel

In an interview with the BBC World Service Radio, Patrick Stewart said that he’s not terribly enthused about space travel:

“I’m a bit of a wet blanket when it comes to the whole business of space travel,” he said in a BBC interview.

As commander of the USS Enterprise on the show, his character Captain Jean-Luc Picard is an avid space traveller.

In an interview with BBC World Service radio, Stewart said he backed unmanned missions such as NASA’s Mars rover Opportunity and the UK’s Beagle 2 mission.

[…]

“As I get older my unease at the time and the money that has to be spent on projects putting human beings back to the moon, and on to another planet, is so enormous,” he said. […]

Of all people, I figured he would be somewhat excited about space travel. Still, I can understand his concerns about the costs involved; while I support NASA’s efforts as a whole, I’m not sure how I feel about the proposed Moon Trip II.