Nested tags for italicized hyperlinks

I tweeted a question the other day about nesting <em> and <a> tags, to figure out which is better:

<em><a href="#">blah</a></em>

or

<a href="#"><em>blah</em></a>

blah or blah

Both are valid HTML, and browsers render them the same way. I’m also pretty sure that I’ve used them interchangeably in the past, and that I’ve asked myself the “which way is right?” question many times before. But enough! It’s time for me to have a definitive answer based on solid reasoning, not just an arbitrary decision, so that if I ever forget, I can retrace the logical steps and come to the same answer every time.

For me, the primary use case for nesting tags like this is to hyperlink book, film, or album titles. I wrap these titles in an <i> tag rather than an <em> tag. (See Oli Studholme’s article at HTML5 Doctor for an in-depth look at the semantic differences between the two.) Like so:

<a href="http://www.allmusic.com/album/clockwork-angels-mw0002332023"><i>Clockwork Angels</i></a>

Clockwork Angels

It was Vasilis who pointed out that the correct order of the nesting becomes immediately apparent if you add more text, only some of which belongs inside the inner tag:

<a href="http://us.macmillan.com/redshirts/JohnScalzi"><i>Redshirts</i> by John Scalzi</a>

Redshirts by John Scalzi

So that’s the answer: for linked titles (or ship names, or taxonomic designations), the link always goes on the outside.

Golf

Fiona and I played 9 holes of golf on the par-3 F-course at Spaarnwoude yesterday. Fiona has hit balls on the driving range before, and played a few holes at Archerfield last month, but this was her first time doing a full 9 holes here in the Netherlands. We both had great fun.

Garbage at Melkweg, 19 June 2012

Garbage’s new album Not Your Kind Of People has seen a mixed reception: fans love it, but critics have generally gone “meh.” My own first impression of it was that even the heavy rock tracks like “Man On A Wire” felt pretty lightweight compared to their older material. It took me few listens to catch the flow of the album, and to get caught up in the hooks and grooves. There are some really good songs on there. “Blood For Poppies” has a bouncy sing-along chorus that belies its stark lyrics about war and battle. “Felt” has a throbbing drum and guitar backbone with the kind of melty vocals I find hard to resist. And “Automatic Systematic Habit” is a wicked synth-heavy opener that I would rate as one of their best ever songs, if it weren’t for how terrible and plain the first verse is compared to the tight interlocking slickness of the second.

That didn’t seem to bother anyone else at the gig, though. Melkweg was sold out. The crowd roared with approval when the band walked on stage, and went into a positive frenzy when Automatic Systematic Habit was what they kicked off with. Other songs from the new album got a good reception, too, but it was the older hits that got the biggest cheers. “Cherry Lips” and “Only Happy When It Rains” in particular raised the roof.

Shirley Manson looked great on stage, her hair up in a severe knot, strutting around with all the controlled aggression the songs demanded. Duke Erikson was absent, but Eric Avery took up bass duty and prowled around the stage like a groovy panther. I love watching drummers play, but unfortunately I didn’t see much of Butch Vig — the stage at Melkweg is low, and the Dutch are very tall. Fortunately, Garbage will be returning to Amsterdam in November to play Parasido, which is my favourite venue. This time, I must remember to buy tickets early, so that I’m not stuck buying them after-market.

  1. Automatic Systematic Habit
  2. Shut Your Mouth
  3. Temptation Waits
  4. Queer
  5. Metal Heart
  6. Stupid Girl
  7. Why Do You Love Me
  8. Control
  9. #1 Crush
  10. Cherry Lips (Go Baby Go!)
  11. Blood For Poppies
  12. Special
  13. Milk
  14. Man On A Wire
  15. I Think I’m Paranoid
  16. Bad Boyfriend
  17. Only Happy When It Rains
  18. Push It

Encore:

  1. Big Bright World
  2. The Trick Is To Keep Breathing
  3. Vow

Scotland holiday

26 May – 3 June 2012:

  • Oban in the sunshine
  • Fish and chips in Oban…two days in a row
  • Hiking up Beinn Lora on a hot, hot day. Picnic at the top, with simply astonishing views.
  • The tour around Oban distillery. Oh, the smells!
  • Lovely accomodation at Lagnakeil Lodges
  • Sitting around in the quiet, reading books
  • The power station under the mountain at Ben Cruachan
  • Finally getting Alex & Fiona in to see The Avengers!
  • Gorgeous lunch at the Plumed Horse; catching up with Tony and Ian
  • Visiting Pulp Fiction on Bread Street for the first time
  • The amazing Pine Lodge at Archerfield
  • My first (half) round of golf in… four years? Let’s not talk about scores.
  • Private in-house family dinner with a personal chef
  • A mince pie and a fudge donut on Haddington High Street while watching the festival parade go by
  • Watching the kids skate and ride about at Space in North Berwick
  • Full Scottish breakfast whilst hung over

Best of all: spending so much time with my family.