Each element type comes with its own CSS classes, so you can upload a file named PennController.css to your PCIbex Farm project’s Aesthetics folder (css_includes on the original Ibex Farm).
When an element is printed, it adds four HTML nodes to the page: one node, the container, which embeds three other nodes. One embedded node is the element itself, and the two other nodes come before and after the element’s node (see the standard .settings.before and .settings.after commands). Each node receives specific CSS class names.
When you use [js]newText(“dots”, “…”).print()[/js], this is what gets added to the page:
.PennController-Text-container
.PennController-dots-container
.PennController-Text-before
.PennController-dots-before
.PennController-dots
.PennController-Text-after
.PennController-dots-after
If you want to add 10px above and below each Text element on the page, you can write this in your PennController.css file (remember Ibex’s automatic prefix policy—see note above):
[css]
.Text-container {
margin: 10px auto;
}
[/css]
It is important to understand and keep in mind that elements’ nodes are embedded in a container, along with a before and an after node. Most often, you will want to target the container rather than the element’s node itself. For example, if you defined [css]font-size: 2em;[/css] on a Text element’s node, any text added with .settings.before or .settings.after would remain unaffected.
Say you want to underline this specific Text element:
[css]
.dots {
text-decoration: underline;
}
[/css]
Or in this case, you could also directly use the command .settings.css on the Text element:
[js highlight=”2″]
newText(“dots”, “…”)
.settings.css(“text-decoration”,”underline”)
.print()
[/js]
Index
- Tutorial
- Commands by element categories
- Standard Element Commands
- Audio element
- Button element
- Canvas element
- DropDown element
- EyeTracker element
- Function element
- Html element
- Image element
- Key element
- MediaRecorder element
- Scale element
- Selector element
- Text element
- TextInput element
- Timer element
- Tooltip element
- Var element
- Video element
- Youtube element
- Special clear command
- Special end command
- Global PennController Commands
- PennController
- PennController.AddHost
- PennController.AddTable
- PennController.CheckPreloaded
- PennController.Debug
- PennController.DownloadVoiceButton
- PennController.FeedItems
- PennController.Footer
- PennController.GetTable
- PennController.GetURLParameter
- PennController.Header
- PennController.InitiateRecorder
- PennController.PreloadZip
- PennController.ResetPrefix
- PennController.SendResults
- PennController.Sequence
- PennController.SetCounter
- PennController.Template
- Installing PennController
- Ontology
- Aesthetics
- Preloading resources
- ZIPped resources
- Spreadsheet (CSV)
- Canvas creation
- Setup for audio recordings collection