DEV Community

matt swanson
matt swanson

Posted on • Originally published at boringrails.com on

1 1

Setting CSS classes in Markdown with Jekyll

Writing blog posts in Markdown is just great. This blog is written in Markdown!

But sometimes you might be tempted to drop down to raw HTML to add some extra styling.

Usage

Jekyll uses Kramdown under-the-hood to render your Markdown by default.

In Kramdown, there is a feature called “Block Inline Attribute Lists”, which is an extension of standard Markdown syntax.

A simple paragraph with an ID attribute.
{: #para-one}

> A blockquote with a title
{: .pull-quote }
Enter fullscreen mode Exit fullscreen mode

You use {: CSS_SELECTOR } to attach additional HTML attributes to the rendered Markdown output.

Jekyll CSS classes

It’s great for adding small embellishments to your posts without having to drop down to raw HTML.

Additional Resources

Kramdown Doc: Inline Attribute Lists


Neon image

Resources for building AI applications with Neon Postgres 🤖

Core concepts, starter applications, framework integrations, and deployment guides. Use these resources to build applications like RAG chatbots, semantic search engines, or custom AI tools.

Explore AI Tools →

Top comments (0)

Image of PulumiUP 2025

Let's talk about the current state of cloud and IaC, platform engineering, and security.

Dive into the stories and experiences of innovators and experts, from Startup Founders to Industry Leaders at PulumiUP 2025.

Register Now

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay