styles_and_script
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
styles_and_script [2022/12/02 10:53] – removed - external edit (Unknown date) 127.0.0.1 | styles_and_script [2023/09/26 08:22] (current) – [Use JS to add a link to the project footer] jsmith | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Styles and Script ====== | ||
+ | Xerte has been created so that people with no web development knowledge can create web based learning objects. | ||
+ | |||
+ | The Styles and Script optional properties are available at project and page level. | ||
+ | |||
+ | If you want to learn more about CSS or JavaScript for web development, | ||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | ===== CSS ===== | ||
+ | |||
+ | The aim of CSS is often to apply style changes (such as colour, fonts sizes) across several areas, in fewer steps than having to make those changes manually using the text-editor options. | ||
+ | |||
+ | - In the HTML Source of the Page, from any text editor by clicking the HTML toggle button <> | ||
+ | - In the optional property Styles box: | ||
+ | - at project, where the changes will apply to all relevant pages in the project | ||
+ | - page level, where the changes will apply only to the page to which it is added | ||
+ | - As a separate stylesheet file (saved in .css format), uploaded to the Media Browser, and applied at project level using the Stylesheet optional property. | ||
+ | |||
+ | ===== Script ===== | ||
+ | |||
+ | JavaScript (JS or JQuery) is described as the programming language of the web and can be used to introduce new functions to your project. | ||
+ | |||
+ | - In the HTML [[source_view|source view]] of the Page, from any text editor by clicking the HTML toggle button <> | ||
+ | - In the optional property Script box: | ||
+ | - at project, where the function(s) will apply to all relevant pages in the project | ||
+ | - page level, where the function(s) will apply only to the page to which it is added | ||
+ | |||
+ | ===== Examples ===== | ||
+ | |||
+ | ==== Add CSS to make a responsive iframe ==== | ||
+ | |||
+ | * Add the Styles optional property to your project' | ||
+ | * Add this CSS code to the Styles box, to create a container class to go around the iframe code: <code css> | ||
+ | * Then add this CSS to style the iframe so that it fits inside the container with full height and width: <code css> | ||
+ | * In HTML view in your Xerte page text editor: | ||
+ | * Paste in the iframe embed code | ||
+ | * Surround the iframe embed code with: <code css>< | ||
+ | * Add this class to the iframe code: <code css> | ||
+ | * It should look like this: <code css>< | ||
+ | |||
+ | ==== Add CSS to format the Page Timer ==== | ||
+ | |||
+ | * Add the Styles optional property to your project' | ||
+ | * Add this CSS code to the Styles box, to format the timer. | ||
+ | |||
+ | ==== Use JS to add a link to the project footer ==== | ||
+ | |||
+ | * Add the Script optional property to your project. | ||
+ | * Add this code to the Script box, replacing the "add url here" with the link you want to add: <code javascript> | ||
+ | |||
+ | {{tag> |