Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Centering content

Started by Mikkel 9 years ago · 1 replies · 897 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 Pedro M, 2 months ago
4 193 2 months ago
Themes & Styling · by Ian, 2 months ago
3 90 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 449 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 44 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 123 3 months ago