During a rebuild of my site this week, I was exploring more ways to incorporate my branding, since it’s one of the strongest methods for helping your website stand out.
I have this alternate logo design, like a “stamp,” that I use sparingly, and thought it would work great overlapped on my image in this section below:
It overlaps the edge of the image just enough to break up that hard rectangle, and it ties the photo back to the brand. These are the micro decisions that make your design unique and give it character.
The quick route would be to export the photo and stamp together as one flat image, but since the stamp hangs off the corner, all that extra empty space becomes part of the image. That throws off your alignment and spacing, and the stamp shrinks right along with the photo on mobile.
My advice for accomplishing these types of “accents” in development is to use pseudo-elements.
So what’s a pseudo-element?
Every element on a page can have two extra layers attached to it, ::before and ::after. You add them with CSS, and they can be anything from a shape, a line, a color or an image, and you can position them wherever you want.
For my stamp, I added a class to the container around the photo and attached the stamp with ::after using CSS like this:
.stamp-image { position: relative; }
.stamp-image::after {
content: “”;
position: absolute;
right: -40px;
bottom: -40px;
width: 120px;
aspect-ratio: 1;
background: url(“awd-stamp.svg”) center / contain no-repeat;
pointer-events: none;
}
Those negative values are what push it past the edge, and that overlap is really what makes the section feel layered instead of just placed.
When to use one (and when not to)
I use a pseudo-element when the detail is purely decorative. Heading accents, shapes behind photos, big quote marks on testimonials and image overlays all fit the bill for using a pseudo.
I recommend skipping them for anything that carries meaning, anything someone needs to click, or anything that changes from page to page. Screen readers don’t always handle pseudo-element content well, so if a visitor would miss it, it belongs in the actual content.
My tip: Ask yourself if it’s necessary to understanding your page content. If not, it’s a great candidate for a pseudo-element.
The Design to Dollars Takeaway
The stamp was a design decision, but it only works because of how it was built. When design and development happen side by side, details like this don’t get flattened into a quick workaround on the way from the mockup to the live site, and that’s usually the difference between a site that looks good on launch day and one that still looks good a year later.
Thanks for reading,
