Is there any way to format text in SharePoint image captions?

Anonymous
2025-01-17T18:37:43+00:00

Is there any way to apply standard formatting, such as italics or font color, to captions on images in SharePoint pages? I am more interested in this for images placed in Text web parts, but I also can't format caption text for the Image web part.

Microsoft 365 and Office | SharePoint | For education | MacOS

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2025-02-08T06:08:32+00:00

Dear James,

Yes, you are right.

Based on my test, custom script needs to be enabled for the Embed web part with HTML code. The administrator can enable it every 24 hours via SharePoint Online Management Shell. Set-SPOSite https://contoso.sharepoint.com/sites/sitename -DenyAddAndCustomizePages 0

The SPFX solution is the alternative way of the custom script. It runs within the SharePoint Framework and doesn't rely on the custom script settings for its execution.

@Webbrewers, there may be no specific article about that currently. Similarly, you can see the detailed information about the SPFX part in Security considerations of allowing custom script - SharePoint in Microsoft 365 | Microsoft Learn.

Thank you for your time and effort.

Sincerely

Cliff | Microsoft Community Moderator

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

28 additional answers

Sort by: Most helpful
  1. matt howell 3,511 Reputation points
    2025-02-07T15:53:34+00:00

    However, the SPFX solution will still work after it is disabled automatically as the SPFx solution runs within the SharePoint Framework and doesn't rely on the custom script settings for its execution.

    Is that documented anywhere? There have been many posts about script editor web parts not working after custom scripting is disabled. I haven't come across that but given the confusing information communicated by Msft, this really needs an official, clearer answer. I haven't seen anywhere that custom scripting is ONLY needed for installing solutions, and that they'll continue working after it's disabled.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2025-02-07T06:53:14+00:00

    Ah, I see. I think this fully clarifies my options. This is my understanding:

    • Custom script is required to render HTML or ASPX files in Libraries other than Site Pages. Using the Embed web part relies on this. This is therefore not an option unless my organization allows custom script. This seems unlikely, and appears to be deprecated by Microsoft. https://learn.microsoft.com/en-us/sharepoint/security-considerations-of-allowing-custom-script
    • Modern script editor and InjectCSS would have to be deployed by my administrator. (They may need to enable custom script temporarily in order to get them into the app catalog, but I don't have to worry about that.) They could then be used to format page parts through CSS, respectively on a page or throughout a site.

    Is that correct?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2025-02-07T05:53:51+00:00

    Dear James,

    Thanks for your updates.

    Yes, Custom Script is temporarily needed for the SPFX solution. However, the SPFX solution will still work after it is disabled automatically as the SPFx solution runs within the SharePoint Framework and doesn't rely on the custom script settings for its execution.

    Thank you for your time and effort.

    Sincerely

    Cliff | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2025-02-07T04:34:53+00:00

    You say, "the alternative way of the custom script is the SPFX solution". I cannot understand.

    The Modern Script Editor is an SPFx solution. However, custom script must be enabled in order to use it: https://www.sharepointdiary.com/2020/11/add-custom-css-to-sharepoint-online-modern-page.html. So how are they alternatives?

    Do you perhaps mean that custom script is required to install an SPFx solution, but that once it's installed custom script can be disabled, and the SPFx solution will still function?

    Was this answer helpful?

    0 comments No comments