Tag: css

Jakob Nielsen, Father of ‘Fast and Cheap UI’

World's Best CSS Developer

An early influence on my UI/UX interest was Jakob Nielsen at useit.com/alertbox. I devoured his articles on how people use the web, worst-practices (unfortunately far too many are still in use today), and common traps.

Learning from useIt.com, webpagesthatsuck.com and others, I grew my skills from definitely sucks to still sucks, but less. I started noticing how people use websites and how those sites are inadvertently designed to make things harder to get done. I would check in every once in a while to see the useit “state of the web” article on usability issues and successes.

A few weeks ago, I thought about the useit site and realized I hadn’t been there in quite a while—since probably before COVID—and decided to check it out. I noticed it redirected to NNGroup.com/articles. After clicking around for a bit, I tried to find the latest state of the web. I clicked on his author name on one of the old articles and it brought me to his page:

Jakob Nielsen, Ph.D., is a retired principal and co-founder (with Dr. Donald A. Norman) of the Nielsen Norman Group. Jakob established the "discount usability engineering" movement for fast and cheap improvements of user interfaces and invented the heuristic evaluation method.
RETIRED!

Wait, he got older and retired‽ Noooo…

All is not lost, as it seems others have taken up the mantle. There are State of UX 2026 and UX Year in Review Quiz for 2026, with hopefully more to come!

Related Sites

Do it correctly: decoupling presentation from content

Box model in CSS

Box model in CSS (credit: Wikipedia)

I recently ran across the anti-pattern of what I see as a common problem amongst designers and developers: coupled presentation and content. I’ve found that decoupling the presentation from the content makes things much easier to write, maintain and expand.

Here’s a simple example:

HTML

<section>
    <div class="margin-top-10">Lorem Ipsum</div>
</section>

CSS

.margin-top-10 { margin-top: 10px };
.margin-top-20 { margin-top: 20px };
(etc)

Take a look at what is going on here: we’re adding a 10px margin to the top of the div. DON’T DO THIS. You want your class names to be contextual, not descriptive of the style.


Rule of thumb

To change the layout, you should only have to edit the CSS, not the HTML.

Here’s where our anti-pattern falls down and will cause grief.

  1. You decide to adjust the positioning of the section. You can:
    • Edit the CSS, changing the class’s margin value and breaking every other element that uses that class.
    • Edit the HTML create a new class, then edit its CSS class definition. If you have to experiment with different margin values, you’ll need a LOT of classes. “Will 14px work or 15px? What about .25em? Argh!”
  2. You can’t have too many attributes in each class, because they will have unintended consequences for the other elements that are using them. Add a red border to one class because you need a border for a specific element, now you have red borders on ALL the elements that share that class. So, you’ll have to have many single- (or few-) attribute values, and include all of the necessary ones on the required HTML elements.
  3. The violent psychopath maintenance programmer (who knows where you live) will kill you in your sleep. You have made her job insanely hard by turning this:
<div class="margin5 blueborder mediumwidth floatingleft" ...

into this

<div style="margin:5px;border:3px blue outset;float:left;width:75%" ...

for no good reason.

The Cure

Think about the element in terms of content or a functional space. What is it and what does it do? In our example above, let’s assume it is the lede section of an article. Then we would do:

HTML

<section>
    <div class="lede">Lorem Ipsum</div>
</section>

CSS

.lede { 
  margin-top: 10px;
  border-bottom: 2px #9fe2f9 outset;
  float: right;
  position: relative;
  width: ...
};

By decoupling the content (div) from the presentation (style-dependent class), we are free  to adjust the style of that element by making whatever changes to the CSS and leaving the HTML alone.

“But,” you shriek, “I have common elements for everything! Rounded corners! Gradients! (except IE…) Et cetera!”

 

For this, we will turn to our trusty companions Less and/or Sass in a future post.

SASS: Style w/ Attitude

SASS: Style w/ Attitude

Enhanced by Zemanta