Storyline 360 Tutorial

How to Customize Closed Caption Width in Storyline 360 with JavaScript

Closed captions are critical for digital accessibility, allowing deaf or hard-of-hearing learners, non-native speakers, and users in noisy environments to engage with video content. However, the default caption width in Articulate Storyline 360 can sometimes obscure visual elements or stretch text too far across wide desktop screens.

By injecting a short JavaScript snippet into a slide trigger, developers can dynamically modify the CSS layout of caption boxes to enhance readability.

Benefits of Customizing Closed Caption Width

  • Improved Readability

    Wraps lengthy caption strings into shorter, more legible text blocks that reduce eye strain.

  • Layout Optimization

    Prevents caption containers from blocking crucial slide graphics, visual aids, or UI controls.

  • Enhanced Visual Balance

    Ensures closed captions align seamlessly with custom player branding and aspect ratios.

Step-by-Step Implementation Guide

  1. 01

    Configure the Execution Trigger

    • Open your project slide and locate the Triggers panel on the right interface menu.
    • Select Create a new trigger.
    • Set the trigger parameters:
      • Action: Execute JavaScript
      • When: Timeline starts
      • Object: Target slide
  2. 02

    Add the CSS Injection Script

    Click the JavaScript link in the trigger wizard and insert the following code snippet:

    const addCss = css => document.head.appendChild(document.createElement("style")).innerHTML = css; addCss(".view-desktop .caption, .theme-unified .caption { width: 50% !important; }");

    (Note: You can adjust the width: 50% percentage value up or down to fit your specific layout requirements.)

  3. 03

    Test and Verify Output

    Publish or preview the slide to confirm that closed captions dynamically render at the newly assigned container width.

Script Functions and CSS Selector Breakdown

Selector / Function Technical Purpose
document.createElement("style") Generates an inline <style> element block dynamically inside the HTML head.
.view-desktop .caption Targets the legacy desktop skin wrapper class for closed caption overlays.
.theme-unified .caption Targets the Modern Player unified skin wrapper class for closed caption containers.
width: 50% Overrides default container width, causing single long lines to wrap into compact multi-line blocks.
FAQ

Frequently Asked Questions

Will customizing caption width affect mobile responsiveness?

The selector targeting .view-desktop applies specifically to desktop displays. For mobile devices, default responsive behavior generally overrides hardcoded widths to maintain screen clarity.

Do I need to place this JavaScript trigger on every slide?

No. Injecting the style block once on the main Slide Master or first slide applies the custom CSS rule globally across the browser session.

Can I use this same method to change caption text size or background color?

Yes. You can append additional CSS properties like font-size: 18px; or background-color: rgba(0,0,0,0.8); directly inside the string function.

Related Solutions

Explore Related eLearning Solutions

Custom E-learning Solutions

Design tailored digital instruction built from inception to scale across global regions and localized languages.

Learn more about Custom E-learning Solutions

Learning Management System (LMS)

Streamline enterprise skill tracking, manage compliance verification effortlessly, and deliver seamless interactive training.

Learn more about Learning Management System (LMS)

Off-the-Shelf Courses

Instantly deploy interactive, SCORM-compliant training modules from a pre-curated digital course catalog.

Learn more about Off-the-Shelf Courses
Get in Touch

Ready to Transform Your Training?

Get a tailored project proposal, custom timeline, and a free SCORM sample built directly from a slice of your existing training materials.

  • Free Proof-of-Concept

    Send us a short document or presentation, and we'll transform it into an interactive SCORM sample so you can judge our instructional design.

  • Expert Consultation

    Talk directly with our eLearning specialist to align your business goals with the right technology stack.

  • Transparent Pricing

    Clear cost estimates and realistic project milestones delivered with zero hidden fees.

Prefer direct email? Reach our lead team at [email protected].

Send Us a Message

Fill in a few details and we'll get straight back to you.