Use CSS in Template Code
You can use CSS as local styles using the style attribute directly on any HTML element in a template. For example:
You can also use the class attribute to refer to CSS classes defined in external CSS stylesheets. You must include <link> elements in the template to link to any external CSS stylesheets.
External CSS stylesheets used in templates must either:
Have a fully-qualified URL where the stylesheet is hosted. For example:
<div>
<link type="text/css" rel="stylesheet"
href="http://www.jackbe.com/prestodocs/v3.0/prestodocs.css"/>
<div
>
<div
>View Title</div>
...
</div>
</div>
Generally, you should use this option for external stylesheets hosted by third parties or custom stylesheets for your organization that are hosted outside of Presto. Hosting custom stylesheets for your organization in the Presto or Presto Hub web applications is not recommended as this complicates deployment and upgrade migrations.
Have been uploaded to
Presto and use a
Presto URL.
This option is recommended for custom stylesheets for your organization or from third-parties when they cannot be hosted outside of Presto or these resources should be available for use in any custom view.
Note: | External resources can only be uploaded to Presto by Presto administrators. |
This example links to a stylesheet that has been uploaded to Presto. The full path for this URL is defined when the resource is uploaded, but is generally in the form http:app-server:port/presto/files/filename:
<div>
<link type="text/css" rel="stylesheet"
href="http://localhost:8080/presto/files/myView.css"/>
<div
>
...
</div>
</div>