Custom Css class in confluence

gopuravi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 18, 2020

I want to apply custom css class to the HTML tags in confluence. I tried adding css class in HTML macro as well as in css Macro. but the style is reflecting only in the preview, when i save and view the page style is not available, any advice

HTML Macro:

<head>
  <style>
    .myClass {
      padding: 18px;
      background-color: Grey;
    }
  </style>
</head>
<body>
  <div class="myClass">
    <p>Answer will be posted here.</p>
  </div>
</body>

Css Macro

.myClass{  padding:  18px;  background-color: Grey;

}

Preview enter image description here

When i save and publish

enter image description here

1 answer

0 votes
Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 19, 2020

Well the Cloud version does not support custom CSS, a downside to that version. What you need to do is to use the browsers inspect function to look at three things:

  1. How your macro is actually rendered
  2. Are you rules being loaded at all
  3. Are there any other rules overriding yours

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events