tomliv
Gold Coder
We're all about components these days right? Here's a situation I struggle with frequently.
You are making a reusable card component - theoretically built as reusable and should be able to be placed anywhere you need a card-type layout. There is an image on left, and copy on right. Copy has a "headline" and a paragraph. Maybe followed by a call-to-action button. Sounds very typical, right?
Here's where I stumble...
On one page, the heading hierarchy leads you to make the card headline an h2, lets say. But if this is supposed to be reusable anywhere, dropping a card with an h2 on another page might put the heading hierarchy out of order or even skip a level.
What's the right way to handle this? I am not talking about visual look of the headline. I'm talking accessibility. Do you just skip a heading element altogether and make it a paragraph and class it to style?
You are making a reusable card component - theoretically built as reusable and should be able to be placed anywhere you need a card-type layout. There is an image on left, and copy on right. Copy has a "headline" and a paragraph. Maybe followed by a call-to-action button. Sounds very typical, right?
Here's where I stumble...
On one page, the heading hierarchy leads you to make the card headline an h2, lets say. But if this is supposed to be reusable anywhere, dropping a card with an h2 on another page might put the heading hierarchy out of order or even skip a level.
What's the right way to handle this? I am not talking about visual look of the headline. I'm talking accessibility. Do you just skip a heading element altogether and make it a paragraph and class it to style?