Centering text, but only when there’s just one line of it

I just spent a fair bit of time figuring this out and thought I’d document it in case someone else is looking for the same thing.

What I wanted to do was center some text if there was only one line, but left-align it if the text spilled over to a second (or more) line:

Screenshot 2016-02-21 19.09.50

After going down a bit of a rabbit hole w/r/t ::first-line and :text-align-last, and even considering employing some JavaScript, I realized there’s actually a pretty vanilla way of achieving the effect:

div.parent { text-align: center; }
p.child { display: inline-block; clear: both; margin: 0 auto; text-align: left; }
Centering text, but only when there’s just one line of it

Making a Thing for People to Use

At Joel‘s patient urging, I finally got around to reading Will Oremus’s piece about Facebook’s news feed algorithm in Slate. I found it to be a really rewarding “long-read”. Here are my thoughts.


It’s always exciting to find faithful portraits of what I do for a living, since it can be difficult to describe to people. The art and science of it is basically:

  1. Put an initial stake in the ground in terms of the functionality we think is going to be useful.
  2. Gather data on the usage of that functionality.
  3. Interview real people about how they are using it and how they feel about it.
  4. Revisit the functionality with the data and human insights we’ve gleaned and improve it.
  5. Repeat.

user-behavior-venn

Numbers 2 & 3 above barely scratch the surface of a key tension in this work: What users do, what they want, what they think they want, and what they tell you they want are four different things. There’s some overlap, but not as much as one would hope or expect!


We need more solid, narrative descriptions of the limitations of machine learning (AI) at present. I find that non-technical people tend think machine learning can do both more and less than it currently can. The reality seems to be that in some ways our dystopian future is already upon us, but in other ways it’s further away than ever.


The article suggests a subtler point about making products that is generally overlooked: Luck and randomness are built into this process, but that doesn’t mean we shouldn’t approach it analytically.

Each person on a team like FB’s product team brings something different to the table, and each one of them has their own stuff going on that makes it harder or easier for them to hear their teammates’ views. The fact that feature development begins in such a chaotic place, but can end up with real, testable product recommendations that, once implemented, are frequently successful is amazing. It speaks to the fact that trying to do something methodically and scientifically, while never perfect, is better than the alternative.


If the Facebook employees featured in this article are a representative sample, Facebook is a very young, white, male place. That’s not entirely surprising, of course, but the fact that this cohort is setting the standard for technology of this kind globally is problematic.

Making a Thing for People to Use

Et tu, NPR, mi fili?

For some inexplicable reason, NPR decided to announce its special coverage of the UN climate talks in Paris with a question:Screenshot 2015-11-03 19.08.14

First off, clearly they think climate change matters – at least enough to warrant special, month-long coverage.

Also, surely someone at NPR is familiar with Betteridge’s Law of Headlines:

“Any headline that ends in a question mark can be answered by the word no.”

It would be a bold move on NPR’s part, suggesting climate change doesn’t matter. But given their overall patchy coverage of the issue, maybe we shouldn’t be too surprised.

All of that said, the recent rise of the Cavuto mark seems to contradict Betteridge. When Fox News asks questions like “Have the Democrats forgotten the lessons of 9/11?” or “Is the liberal media helping to fuel terror?”, we can assume they expect their viewers to supply an answer of “yes”. Perhaps that is likewise NPR’s intent.

Either way, phrasing their headline as a question absolves NPR of being accountable for what they’re writing and makes the implicit claim that climate change is up for debate.

But it isn’t. So to answer your question, NPR: Yes, climate change matters. It’s possibly the only thing that matters at the moment, actually.

Et tu, NPR, mi fili?

WaPo’s Police Shootings Graphic

First off, it is awesome and you should go look at it right now: http://www.washingtonpost.com/graphics/national/police-shootings/

I am struck in particular by their focus on individual human beings; each victim* is represented as a single figure in the timeline graphic the Post leads with:

Screenshot 2015-07-25 11.22.05

Below the original graphic space, the Post shows each victim as an individual, with details about the circumstances as well as a photo when possible. This further emphasizes the humanity of each person.

Screenshot 2015-07-25 11.47.55

That all said, I feel like some key context is left out of the graphic that just as easily could have been included, and would have made the racial aspect of these numbers manifestly more obvious.

Screenshot 2015-07-25 11.30.45

Almost twice as many white people as black people have been killed by police so far this year. This figure alone, without context, dramatically undercuts the assertion by civil rights activists that blacks are unfairly targeted and killed by police.

Had the Post included census data with those numbers, the impact would be quite different:

Screenshot 2015-07-25 11.41.56

Whites are underrepresented by a third, blacks are overrepresented by half. Only Hispanics are being “fairly” represented in these statistics.


9/23/16 Update: Turns out there was a suitable alternative out there all along! Peep The Guardian’s on-going vigil “The Counted: People killed by police in the US” which has a much better way of showing proportionality:

screenshot-2016-09-23-21-08-06

Thanks to BJ Warshaw for sussing it out.


* I realize how charged it is to use this word, but the police involved in these events might also be termed victims; when deadly force is used, everyone loses.

WaPo’s Police Shootings Graphic