Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to include this line of html into a sharepoint 2007 content section inside a page i have just created. I am the owner.

<link rel="stylesheet" type="text/css" href="/sites/gskglobal/mcLaren-partnership/Documents/live.css" />

I input this using Edit HTML Source on a piece of content (This was the only way i could find out how to input HTML directly).

When i click ok the styles display perfectly having already uploaded the css file.

When i click save it removes the entire link element and leaves me with no stylesheet.

i could put the styles in line, but i really don't want to do this.

N.B no erros are displayed only

Warning: The HTML source you entered might have been modified.

share|improve this question

4 Answers

Both of those will work, however the CSS may get executed AFTER the SharePoint Page is rendered.

The short and simple way is to add the CSS file to any document library (Style Library too). Add the Link script above into a text file and upload that. Add a Content Editor Web Part to the page and through the settings, point it to the TEXT file with the script.

The CEWP part is executed during the HTML creation process when building the page thus the CSS gets executed with the header (like the rest of the CSS for SharePoint).

David Sterling Author MOSS 2007 The Complete Reference www.sterling-consulting.com - davidmsterling.blogspot.com - www.sharepoint-blog.com

share|improve this answer

Try adding your .css file to your main web "Style Library"

share|improve this answer
where would i find this style library? I haven't worked with this mammoth beast before. – Jamie Hutber Dec 12 '12 at 11:21
It should be on your root site. – Mhd. Yasseen Dec 12 '12 at 11:21
I can't find anything that looks like a style library. I have found whilst in edit mode under the page tab a button called library settings, but then searching for style in this brings up nothing – Jamie Hutber Dec 12 '12 at 11:35
1  
Go to your main web, click all site content, and if you have sufficient permissions you would be able to find Style Library under "Document Libraries". Alternatively you can go to [12]\TEMPLATE\LAYOUTS\STYLES and add your file manually, then add the href='_layouts\styles[filepath]' – Mhd. Yasseen Dec 12 '12 at 11:39
It would appear i don't have permissions to this. I sure as hell can't get to the root of the server. But i have looked as per your suggestion, thanks for that :) I will have to scratch around more, but looks like inline styles are calling. – Jamie Hutber Dec 12 '12 at 11:53
show 1 more comment

You need only to publish your css file

  • Go to your all document view
  • find your file
  • publish
share|improve this answer
up vote 0 down vote accepted

The best and easiest way I found to add any form of html into the document when adding a webpart simply add a form then edit the html as you would normally and this will no longer give you the

 Warning: The HTML source you entered might have been modified.

It will just leave the markup in there.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.