It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Creating custom titles using CSS

Avinash Aug 08, 2012


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
Answer accepted
Steffen Heller Aug 08, 2012

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.


Avinash Aug 08, 2012

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

1 vote
CharlesH Aug 08, 2012
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.
Avinash Aug 08, 2012

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. :(

CharlesH Aug 08, 2012

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

1 vote
Amalia San Aug 08, 2012

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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

950 views 0 19
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you