I am trying to reproduce a MediaWiki element inside a Confluence Wiki
Asked by Milen Bilyanov:

Hi,

I have a MediWiki wiki that I am trying to migrate to Confluence. I have a specific element that I was not able to replicate in my Confluence Knowledge Base page.

It looks like this:

panel.png

the code is this:

```
Set these compiler flags:{| style="font-style:regular; font-size:100%; width: 100%; border: 2px dashed; color: #000000; background-color: #FFF9E7;"|-|&lt;code&gt;$ export CC=clang &lt;/code&gt;|- |&lt;code&gt;$ export CXX=clang &lt;/code&gt;|-|&lt;code&gt;$ export FFLAGS=-ff2c &lt;/code&gt;|-|}
```

Could you please help me to achieve this look inside a Confluence Macro Panel?

Thanks,

Milen  
[](https://community.atlassian.com/t5/Confluence-questions/I-am-trying-to-reproduce-a-MediaWiki-element-inside-a-Confluence/qaq-p/281551?attachment-id=3781){#link_1193050b503853}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/243299/1/panel.png){#display_1193050b503853_0}


Answers:
author: Milen Bilyanov
body: Hi Stephen,

Thanks for the answer. I am new to Confluence and I will try your solution, but I still think there should be a simpler solution. I mean, the whole point of Confluence is being able to construct the wiki and knowledge pages really quickly and in a flexible way.

I am trying to understand how CSS works and how one can use custom CSS code, but as I said, this is my second day using confluence. I would expect to be able to inject some kind of a CSS formatting into the main "Place Code" and then access it through the CSS Macros. Any ideas? The solution above just seems a bit too elaborate. However, thanks for the time and the help.


author: Stephen Deutsch
body: Hi Milen,

If you have the Confluence Source Editor (<https://marketplace.atlassian.com/plugins/com.atlassian.confluence.plugins.editor.confluence-source-editor>) and the Content Formatting Macros (<https://marketplace.atlassian.com/plugins/com.adaptavist.confluence.contentFormattingMacros>), then you could paste something like this into your page source (the colors aren't perfectly exact):

```
&lt;p&gt;  &lt;strong&gt; &lt;span&gt;Set these compiler flags:&lt;/span&gt; &lt;/strong&gt;&lt;/p&gt;&lt;ac:structured-macro ac:name="panel"&gt;  &lt;ac:parameter ac:name="bgColor"&gt;#FFF9E7&lt;/ac:parameter&gt;  &lt;ac:parameter ac:name="borderStyle"&gt;dashed&lt;/ac:parameter&gt;  &lt;ac:parameter ac:name="borderColor"&gt;black&lt;/ac:parameter&gt;  &lt;ac:parameter ac:name="borderWidth"&gt;2&lt;/ac:parameter&gt;  &lt;ac:rich-text-body&gt;    &lt;ac:structured-macro ac:name="span"&gt;      &lt;ac:parameter ac:name="style"&gt;background-color:#FDFFFF&lt;/ac:parameter&gt;      &lt;ac:parameter ac:name="atlassian-macro-output-type"&gt;INLINE&lt;/ac:parameter&gt;      &lt;ac:rich-text-body&gt;$ export CC=clang&lt;/ac:rich-text-body&gt;    &lt;/ac:structured-macro&gt;    &lt;ac:structured-macro ac:name="div"&gt;      &lt;ac:rich-text-body&gt;        &lt;p&gt; &lt;/p&gt;      &lt;/ac:rich-text-body&gt;    &lt;/ac:structured-macro&gt;    &lt;ac:structured-macro ac:name="span"&gt;      &lt;ac:parameter ac:name="style"&gt;background-color:#FDFFFF&lt;/ac:parameter&gt;      &lt;ac:parameter ac:name="atlassian-macro-output-type"&gt;INLINE&lt;/ac:parameter&gt;      &lt;ac:rich-text-body&gt;$ export CXX=clang&lt;/ac:rich-text-body&gt;    &lt;/ac:structured-macro&gt;    &lt;ac:structured-macro ac:name="div"&gt;      &lt;ac:rich-text-body&gt;        &lt;p&gt; &lt;/p&gt;      &lt;/ac:rich-text-body&gt;    &lt;/ac:structured-macro&gt;    &lt;ac:structured-macro ac:name="span"&gt;      &lt;ac:parameter ac:name="style"&gt;background-color:#FDFFFF&lt;/ac:parameter&gt;      &lt;ac:parameter ac:name="atlassian-macro-output-type"&gt;INLINE&lt;/ac:parameter&gt;      &lt;ac:rich-text-body&gt;$ export FFLAGS=-ff2c&lt;/ac:rich-text-body&gt;    &lt;/ac:structured-macro&gt;  &lt;/ac:rich-text-body&gt;&lt;/ac:structured-macro&gt;
```

The problem is that the text is really sensitive, i.e. if you change the text in the macro editor, it will break the single word highlighting. I couldn't find a good way to do it otherwise, though. You could use a div, but then it would highlight the entire line and not just the words.


Tags: css

macro