Creating custom titles using CSS


I am trying to assign different font, color and style only to my title of the page. (I also do NOT want to assign the title as h1,h2...h6). I have used the followng css style for the title.


color: #2D637F;

font-family: ="Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;

font-size: 24px;


line-height: 1.5em;}

Now the tilte content is say "Welcome". How do i use wiki mark up to assign the above css code to only this particular heading without using html macro?

plz help...Thanks!

3 answers

1 accepted

1 vote
Accepted answer

Hi Avinash,

you must make sure that the html and the css matches.

The wiki code


My Title


creates the html code

<div class="heading">
<p>My Title</p>

So you have .heading p in html but p.heading in CSS. Change one of them to match the other and it will work.


Thank you so much! Works like a charm! :)

You could use the span or div macros available from the Adaptavist advanced formatting plugin I believe. Those macros allow you to specify inline style attributes or a class.

I tried using div macro in the wiki markup this way


My Title


But nothing happens. Its like i cant make it identify my heading in the markup. :(

I think Steffen may have given you a pointer to make this work. See his answer below.

You can create a custom user macro. Go to Confluence Admin > User Macros > Create a User Macro. Type "title" as Macro Name and Macro Title, and select "Rendered" for Macro Body. For template, add the following:

## @param dummy:title=dummy|type=string

<p class="heading">$body</p>

The parameter I put there is dummy since user macro requires you to put a parameter in order to include it in the Macro Browser.

Add a new page, click Insert Macro and search for "title". Add the title macro into the editor and type the title in the body of the macro.

Don't forget to put the CSS code that you mentioned above into the Stylesheet page in the Confluence Admin.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

933 views 47 7
Join discussion

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