简体   繁体   中英

Adding image and changing text font size in PopupPanel not working

I have code in Google Apps Script for popupPanel, all other properties are working except for adding image and changing the text font size. I have to add small image just below the label text and I have created the perma link for the image with sharing option "Anyone with the link can view". I have used img src property for image and fontSize property for text size. Here is my code:

var app = UiApp.createApplication();

    // Create a popup panel and set it to be modal.
    var popupPanel = app.createPopupPanel();

    popupPanel.add(app.createHTML("Your application has been successfully submitted!<br/><br/>Thank You!<br/><br/><img src='https://docs.google.com/uc?id=..........'/>")).setSize(900, 610).setPopupPosition(370,1208).setStyleAttribute('color','#336600').setStyleAttribute('fontSize','60px').setStyleAttribute('fontWeight','bold').setStyleAttribute('backgroundColor','#FFFFE0');

    popupPanel.show();

I have used dots in above code in place of fileid of image for privacy.

Any idea on this one please?

Thanks

I'm not a fan of popup panels because I don't like them so much but I think they have the same restrictions as HTML widgets in UiApp and Google published a list of authorized html tags that one can use in this context.

The list is as follows : B, BLOCKQUOTE, BODY, BR, CENTER, CAPTION, CITE, CODE, DIV, EM, H1, H2, H3, H4, H5, H6, HR, I, LABEL, LEGEND, LI, OL, P, SPAN, STRONG, SUB, SUP, TABLE, TBODY, TD, THEAD, TITLE, TR, TT, UL.

and the release note where I found this was published in march 2012 (search the page on "march")

As you can see, the img tag is not in the list so it won't work.

As a workaround, use the image class widget to show the image by adding it to the panel.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM