5

Afer saving/ publishing Sharepoint keeps changing the following code FROM THIS.....

A IMG {BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; BORDER-TOP: medium none; BORDER-RIGHT: medium none}

TO THIS....

**.ExternalClass** A IMG {BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; BORDER-TOP: medium none; BORDER-RIGHT: medium none}</style><style>

So it inserts the .ExternalClass identifier and thus prohibits the code from working. Does anyone know a workaround or way to prevent this code from changing?

Basically I'm trying to hide the left hand sidebar and hyperlink object borders from the page using the page source - no webparts.

thanks :)

0

I've had this happen to me with my stylesheets as well. For me, it happens most often when:

- The page that the CSS is on is Checked-In BEFORE Saving the page.
- A Check-Out is Discarded BEFORE Saving the page.

It has to do with SharePoint's "auto-correct" for code that thinks it is "helping."

I'm personally looking into having the CSS sheets in a separate file and somehow linking it to the pages. This would ideally put the sheet far away from the auto-correct and prevent further problems. I can keep you posted on if this works, but, until then, see if the two situations I had are involved in what's happening to yours.

EDIT
I recently found another question that someone asked about CSS stylesheets that solved my problem perfectly. It does involve WebParts though.
Does your application of the stylesheet put it in an "Insert -> Embed Code"?
Instead, try using a Script Editor, found under the Web Parts -> Media and Content -> Script Editor. It encases the code in a kind of "auto-correct" shield that doesn't cause the .ExternalClass to be added.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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