How can I centre align the Livesearch macro?

Does anyone know how I can centre align the Livesearch macro? 

I've tried lots of different things in the Stylesheet, the source editor and the Custom HTML. None are working. Is it even possible to align this macro? At the moment it just drags itself over to the left and looks ridiculous on a nicely formatted page where everything is central.

 

 

3 answers

Have you tried using the section and column macros. You could create 3 columns, leave the left and right columns blank and put your search in the center. You can set the sizes for the column widths by percentages so you can make the center column small enough to just fit the search (say that was 20%) and then split the remaining percent between the left and right columns (in this example 40% each)

Just put the Livesearch macro in the body of a Div macro and add this to the Div macro's Styles field:

margin-left: auto; margin-right: auto; width: 18em

I don't really want to install more third party plugins as there is no guarantee they will be supported in the future... 

Okay, I was able to fix this. If anyone else is interested, I opened the Confluence Source Editor < > and created a new div class (call it whatever you want - I called mine "livesearch-centrealign":

<div class="livesearch-centeralign">
<ac:structured-macro ac:macro-id="1809e123-21d9-49e8-a2bc-278724a5bd6d" ac:name="livesearch" ac:schema-version="1">
<ac:parameter ac:name="spaceKey">
<ri:space ri:space-key="010000"/>
</ac:parameter>
<ac:parameter ac:name="placeholder">Can't find what you're looking for?</ac:parameter>
</ac:structured-macro>
</div>

Then under Space Tools > Look and Feel > Stylesheet:

.livesearch-centeralign {
margin: 0px auto;
display: inline-block;
}

with-additional {
height:auto;
padding-top:3px;
padding-bottom:3px;
text-align: left;
}

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Monday in Confluence

Calling all marketing teams who use Confluence - we want to hear from you!

Hi Community! me again 🙂 If you’re a marketing team using Confluence, we want to hear your story! How did you start using Confluence? What are your use cases? What have been some of the benefits?...

226 views 3 3
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