How to apply CSS to the Expand macro

I understand how to apply CSS stylesheets to a space, but how can I reference the Expand macro objects in the stylesheet?

I have a list of hyperlinks, some of them are just direct URL hyperlinks and others are Expand links (that open up to expand a sub-list of URL hyperlinks). However, when you put a mixture of those right after another, the format looks awful. I think this is because the Expand macro has a different margin setting and so the spacing right after it is different than if it were just a regular <p> object. Any ideas???

To better visualize, here's an example of what I get right now:

And here's what I would like to have:

3 answers

1 accepted

Accepted Answer
0 votes
Davin Studer Community Champion Jul 31, 2014

You could give the expand-control class a 10px margin-top. That should fix it for you. It currently has a 10px margin-bottom, and p elements have a 10px margin-top and no margin-bottom. That is why they butt up against each other. You could add it to either the space or global stylesheet, or if you only want it on one page you could use the Content Formatting Macros stylesheet macro to put a style block in your page.

.expand-control {
    margin-top: 10px;
}

That helps, thank you.

0 votes
Davin Studer Community Champion Jul 16, 2014

If you are using a fairly modern browser they all come with developer tools that allow you to look at the source and css styles for specific elements. That would be the place to go to see what is going on. Also, you may look at the storeage format for the actual page to see if the wysiwyg editor did something wonky. The Confluence Source Editor will let you peek into and edit the storage format.

Never really found a good way to do this.... closing this question since I'm not getting any other answers.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 11, 2018 in Confluence

What are your project planning tips?

Hello Community,  Jessica here from the Confluence product marketing team! Today I wanted to get your takes on project planning –– what works, what doesn’t, how do you know if you’re doing it r...

261 views 1 4
Join discussion

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