简体   繁体   中英

Adding html codes to SharePoint Online

is it possible to add html codes to SharePoint Online? I would like to add a html code from Statista such as the following:

 <a href="https://www.statista.com/statistics/262861/uk-brent-crude-oil-monthly-price-development/" rel="nofollow"><img src="https://www.statista.com/graphic/1/262861/uk-brent-crude-oil-monthly-price-development.jpg" alt="Statistic: Average monthly Brent crude oil price from July 2018 to July 2019 (in US dollars per barrel)* | Statista" style="width: 100%; height: auto !important; max-width:1000px;-ms-interpolation-mode: bicubic;"/></a><br />Find more statistics at <a href="https://www.statista.com" rel="nofollow">Statista</a>

As far as I know only iframe based codes can get entered to SP Online. However, Statista only provides the above mentioned version. Is there any possibility to add these codes to SP Online? Please note that I am really not familiar with such codes.`

Thanks in advance Markus

Only way you can do this OTB is by saving your HTML code as a .aspx page, uploading it into a document library and then using the 'Embed' webpart.

terribly annoying as you have to edit your code separately, but this will allow any/all completely custom code (HTML/CSS/JS) to be inserted into the page.

It's not supported to add html codes in SharePoint modern page. However, you could achieve this in classic page.

Go to Pages library, create a classic page.Click Edit Source in the ribbon and add the code.

在此处输入图片说明

在此处输入图片说明

We can deploy react script editor web part to your site, then add the HTML code into this web part in modern site page. In classic site page, we can use the OOTB script editor web part to achieve it.

在此处输入图片说明

If you have a standard Sharepoint page - click the add button to add a new element and then select "Code Snippet". You can then paste the code there. You may run into some permission issues depending on your setup however.

截屏

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