Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Can i apply css style sheet to a page viewer webpart ?

share|improve this question
    
To the webpart itself or to the contained page? –  Alex Boev Mar 9 '12 at 17:45
    
i want to add in the contained page . I want to apply different styles to the content inside the page viewer wp. –  Nikhil Mar 12 '12 at 14:38
add comment

2 Answers 2

up vote 3 down vote accepted

A page viewer web part is essentially a glorified iFrame, so you can do anything that you would normally be able to do with an iFrame (such as target specific elements of the web page within the iFrame with JavaScript). CSS styling of content within an iFrame is possible in some scenarios, but typically very unreliable across multiple browsers.

If we're talking SharePoint 2010 then (as a best practice) anything you deploy should be supported in IE, Firefox, Safari, and if you're Service Pack 1 or above, Chrome. Many targeted CSS solutions don't work reliably across all browsers. There's a thread here that discusses some of the options.

share|improve this answer
add comment

Solution : Found a solution by doing programatically

Added a custom control to the page which will apply style sheet dynamically. So when i try to open the page the pageviewer runs the code and apply style sheet dynamically. This is best and easiest of solution

share|improve this answer
add comment

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.