Can I add a css class without using source editor?

I currently have a few CSS classes in my CSS stylesheets, for example, p.code1first to change a paragraph's font to Courier and indent the margin-left – code1next to do the same formatting, but without a margin-top.

Is there a way to apply these in the regular edit mode, without editing HTML by hand? I can go into source editor and add class="code1first" to a <p> tag, but is there a way to do this via macros or other keyboard shortcuts?

2 answers

0 vote
Davin Studer Community Champion Nov 29, 2016

You can get the Content Formatting for Confluence add-on (free) and use the "p" macro which has a class attribute in it.

Thanks – I was looking at that add-on, and was wondering if it would do. I'll try it out.

Or you can create a very simple user macro to do the same thing, allowing you to generate a more complex HTML structure if you need it.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

66 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you