I'm not an adminstrator and fairly new to Confluence. I'm trying to add a simple page that looks fine in a browser and not so great when added through an html macro but still. I attached a css file and made a reference to this document and in Preview mode it seems the html is 'listening' to the style sheet. However when I save the page it seems the css is no longer used.. could my style sheet be overruled in some way?
So, My team and I recently ran aground on this same issue. did you check to see if your Styling is in the head of your HTML file? If so, move that into the body. the HTML macro does not read the header of the HTML file.
Once I put what I need in the body it works. We need to use div otherwise the formatting will affect confluence itself and create a mess. Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel,
I have added the styling within <div> under the <body> but still there is an effect to the confluence page; It does not show other panels within the page and also effects the side bar functionality.
I have used the below code and pasted it in a HTML macro on the page.
I do not have admin rights to the space, so i am doing the styling within the page:
<!DOCTYPE html> <html lang="en"> <body> <div><meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> </script></div> <div class="container"> <input class="form-control" id="myInput" type="text" placeholder="Search.."> <br> <table align="left"; class="table table-bordered table-striped"> <thead> <tr> <th>Title1</th> <th>Title 2</th> </tr> </thead> <tbody id="myTable"> <tr> <td>Name</td> <td>212356</td> </tr> <tr> <td>Name2</td> <td>226549</td> </tr> <tr> <td>Name3</td> <td>228056</td> </tr> </tbody> </table> </div> <script> $(document).ready(function(){ $("#myInput").on("keyup", function() { var value = $(this).val().toLowerCase(); $("#myTable tr").filter(function() { $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1) }); }); }); </script> </body> </html>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I talked nonsense. The CSS macro does actually change the page itself. I didn't even know that.
@John: When I try, it works: Including formats with the {CSS} macro, the styling both shows in preview mode and when the page is saved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried several ways. The CSS macro and inline CSS. Both work in preview mode but once saved all styling is gone.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How did you attach the file: Did you use the CSS macro and choose a CSS file at "Import"?
If so, this only works for PDF exports but doesn't change the appearance of the confluence/html page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.