Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Centering content

Started by Mikkel 9 years ago · 1 replies · 1433 views
9 years ago

Hello! I have some content I want centered. It's so far styled with pure markdown. I've created a custom css class to center content which I have used on images in this way: {.center}

How do you guys center content like text without breaking markdown? I guess I could just target all <p> with the same class I use to center pictures, but I only want it on one page, not globally. There's so many ways to do things and I don't want to take an unnecessary complicated route :)

9 years ago

Probably the cleanest way is to use a shortcode like [center][/center]

This is available in the shortcode-core plugin.

👍 1

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by themetman, 6 days ago
1 103 3 days ago
Themes & Styling · by AH, 3 weeks ago
1 223 3 days ago
Themes & Styling · by Bruno, 4 years ago
6 1386 3 days ago
Themes & Styling · by TomW, 3 weeks ago
2 227 5 days ago
Themes & Styling · by FrViPofm, 2 months ago
4 687 2 months ago