Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name: Password:
Ambiera Forum > RocketCake
Adding style to HTML
Author Text

taoz
Registered User
Quote
2022-10-25 12:24:49

Which options are there for adding style to the html code in an HTML container?

I can see that I can use inline CSS for the html elements but is there a way to use an external CSS file so I can change the CSS for multiple pages with HTML containers?


erik
Registered User
Quote
2022-10-25 14:44:32

It's not made for this, but this hack would probably work:

You could just manually link your own css file into the code. Just click View -> HTML Code -> Additional Code in header, and enter something like

<link rel="stylesheet" href="rc_images/mystyle.css" type="text/css"/>  


Then also add a dummy page where you add a hyperlink to your mystyle.css file (link type "File from disk") and select your .css file, then it will automatically placed into the rc_images folder and also automatically uploaded and copied when previewed, I think.

Then you can enter any css style in that file. Won't be visible in the editor, but when you hit Preview.


taoz
Registered User
Quote
2022-10-25 16:37:52

Thank you, will try that.

I'm using a masterpage for the pages in question btw. I can see that masterpages as well as their child pages have separate headers in the editor, so should I add the CSS link to each child page header separately, or will it be possible to just add it to the masterpage?

Or can I maybe just add the child page <style> element to the masterpage header instead of using a separate CSS file?


erik
Registered User
Quote
2022-10-25 17:34:59

Good question. Would just try it out.


taoz
Registered User
Quote
2022-10-25 20:17:43

OK, gave it a try.

It actually seems to work adding a <style> element for the child pages to the masterpage header, you just have to uncheck "CreateDivAroundCode" for the HTML container on the child pages and enclose the html with your own <div> otherwise the HTML container will show up as a grey rectangle on the page, when previewing.

Using an external CSS file link in the masterpage header doesn't seem to work though, the child page does pick it up when previewing but it doesn't seem to have any effect on the code in the child page HTML container. The added CSS link comes before the default CSS in the source so maybe it's getting overwritten by it. Or maybe I'm just doing something wrong.

Anyway, I'm fine with using the method that works.


erik
Registered User
Quote
2022-10-26 08:50:13

Ah, also a nice solution.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inte?national" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© 2020 Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact