- Knowledge Base
- Stylesheets in Assessment Items
- Code Examples
-
TAO Portal Quickstart Guide
-
Rostering in TAO Portal
-
Creating assessment materials in TAO
-
Creating assessments for delivery in TAO
-
Proctoring in TAO Portal
-
Viewing results in TAO Portal
-
How Does Scoring Work in TAO?
-
Writing Your Own Scoring Rules for Your Assessments: An Example
-
TAO Portal Terminology
-
TAO Quickstart Guide
-
Making the Most of the Asset Manager
-
Working With Metadata in TAO
-
Configuring Interactions: What Possibilities do You Have?
-
Randomization in Items and Tests
-
All You Need to Know About Test-Takers
-
All About Deliveries
-
Setting up LTI
-
Proctoring Assessments in TAO
-
Interpreting Results Tables in TAO
-
Using the Advanced Search
-
Best Practices for Working with Multiple Users in a Small-scale Authoring Scenario Part 1: Set-up
-
Best Practices for Working with Multiple Users in a Small-scale Authoring Scenario Part 2: Workflow
-
Optimizing Pictures
-
All About Extensions
-
Stylesheets in Assessment Items
-
TAO for RTL Languages
-
TAO Terminology Explained Part 1: TAO Architecture
-
TAO Terminology Explained Part 2: Creating and Delivering Assessments
-
TAO Terminology Explained Part 3: Scoring Assessments
-
Test-taker and Accessibility tools
-
How does scoring work in TAO? (II)
-
Video demos
-
Video tutorials: Creating interactions
-
Thinking About Test Questions (and Choosing Interactions) According to Task Type
Using backgrounds
This lesson covers the main aspects of background styling but the actual CSS code is slightly more complex. We have added a commented stylesheet to the download section that covers all the details.
Background images
When using background images there are a few things you need to keep in mind.
- They are probably not available during the exam due to the possible restrictions mentioned under Limitations. You should as a backup always use a background color that is similar to the picture’s main color to ensure sufficient contrast.
You will find this online tool helpful: https://matkl.github.io/average-color/. - They should not be larger than absolutely necessary. Consider using a compressor, for example with https://tinyjpg.com/.
- If you want to use pictures that are stored in the item to overcome some of the limitations, you can do two things:
- Export the item, add stylesheet and picture manually and re-import
- Encode the picture as a data-uri, for instance with https://dopiaza.org/tools/datauri
Getting the scope right
In an earlier lesson we have been using html body div.qti-item to target an item. To change a background, your CSS would look like this:
html body div.qti-item { background-color: #ddd;}
As you can see, the part of the test-runner surrounding the item stays white:
The highlighted zone is the item, the test runner remains white
To target the whole area you need to use this target instead:
html body.tao-item-scope { /* no space before the dot! */
background-color: #ddd;
}
Note, that working on the test-runner scope should be done with care. It might have unwanted side effects such as influencing the style of the review bar.
Background images
Let’s say you want to use the following picture as a background:
Picture size |
288 x 288 px |
File size (uncompressed/compressed) |
40kb/16kb |
Average color |
#2c2c2c |
Data-uri |
data:image/png;base64,iVBORw0KG... (shortened) |
(fake) remote URL (if applicable) |
https://example.com/background.png |
Remote URL variation
html body.tao-item-scope {
background-image: url(https://example.com/background.png);
}
Local URL variation
Remember that you have to export and re-import the item in this case
html body.tao-item-scope {
background-image: url(../images/background.png);
}
Data-uri variation
html body.tao-item-scope {
background-image: url(data:image/png;base64,iVBORw0KG...);
}
Shorthand syntax
html body.tao-item-scope {
background: #2c2c2c url(any-of-the-above);
}