Hi,
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.
p.heading{
color: #2D637F;
font-family: ="Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
font-size: 24px;
font-weight:bold;
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!
Hi Avinash,
you must make sure that the html and the css matches.
The wiki code
{div:class=heading} My Title {div}
creates the html code
<div class="heading"> <p>My Title</p> </div>
So you have .heading p in html but p.heading in CSS. Change one of them to match the other and it will work.
Steffen
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried using div macro in the wiki markup this way
{div:class=heading}
My Title
{div}
But nothing happens. Its like i cant make it identify my heading in the markup. :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think Steffen may have given you a pointer to make this work. See his answer below.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.