Stylesheet Code Empty After Save

Jaspal Marok asked on June 25, 2018 17:01

I am trying to create a new CssStylesheet that will be attached to a specific page, Every time I save the stylesheet, the CSS code that I entered just disappears. I don't understand what I am missing.

Is there any other way to attach my CSS to just one page?

Recent Answers


web dev answered on June 25, 2018 17:09

hello Jaspa you can read thid document its helpful adding css to page

0 votesVote for this answer Mark as a Correct answer

Jaspal Marok answered on June 25, 2018 17:17 (last edited on June 25, 2018 17:18)

Nadia Tahir, Currently I am using the work around to tie the CSS to the page template. But ultimately, I want to add the CSS inside the CSS Stylesheet application. Which is not working currently.

0 votesVote for this answer Mark as a Correct answer

web dev answered on June 25, 2018 17:57 (last edited on June 25, 2018 17:58)

in sites application did you select (Site css style sheet ) link

0 votesVote for this answer Mark as a Correct answer

Arindam Debnath answered on June 26, 2018 14:22 (last edited on June 26, 2018 14:22)

Hi Jaspal, is there any custom css handler in your application such as less/sass compiler? They might be causing your css to disappear.

One way to add any css to the page is by using Head Html code webpart within this page's template, then reference your style-sheet via the following in the html code section.

<link href="~/CMSPages/GetResource.ashx?stylesheetname=Main" type="text/css" rel="stylesheet" />

or

<link href="~/CMSPages/GetResource.ashx?stylesheetfile=~/..../file.css" type="text/css" rel="stylesheet" />

I hope this helps.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.