Change Code block font-size

License Manager Stratech April 14, 2013

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

0 votes
Answer accepted
Sean Curtis
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 7, 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;
}

0 votes
License Manager Stratech May 7, 2013

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
Atlassian Team members are employees working across the company in a wide variety of roles.
May 7, 2013

You can comma-separate those two.

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

License Manager Stratech May 7, 2013

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

0 votes
License Manager Stratech May 6, 2013

Is there anyone that can help me?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events