Change Code block font-size

I've really like to change the font-size of a code block in confluence. Therefore i need to 'change' the css, this can be done in > Space Administration > Space Stylesheet part of Confluence.

I'm struggeling trying to get the right css-code in there.

I've tried many different things, but i seem not to be able to fix this. Using inspect element in Chrome gave the the following:

Looks i've got to deal with the ".syntaxhighlighter div", because if i'm changing the value of the font-size here (in the above image where my cursor is), the font actually changes.

Now the question is how to get this overridden in the Space Stylesheet....

3 answers

1 accepted

This widget could not be displayed.
Sean Curtis Atlassian Team May 07, 2013

Your CSS selector is wrong. You are matching "code" (element) instead of ".code" class.

Even if you fix this, it won't work. Try this instead:

.syntaxhighlighter .code .container * {
    font-size: 8px !important;
    line-height: 20px !important;
}

This widget could not be displayed.

Is there anyone that can help me?

This widget could not be displayed.

The answer of Sean did do the trick. I did try different stuff, and at the end I came up with the following final solution:

.syntaxhighlighter .code .container *
{
    font-size: 12px !important;
    line-height: 14px !important;
}

.syntaxhighlighter table td.gutter *
{
    font-size: 12px !important;
    line-height: 14px !important;
}

Sean Curtis Atlassian Team May 07, 2013

You can comma-separate those two.

.syntaxhighlighter .code .container *,
.syntaxhighlighter table td.gutter *
{
    font-size: 12px !important;
    line-height: 14px !important;
}

Sean, you are right. First i had a difference between those two styles, thats why i had two. But at the end they were the same.... Thanx

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted 33m ago in United States

Local Atlassian Research Workshop opportunity on Sep. 28th

We're looking for participants for another workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sh...

8 views 0 0
View post

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