locked
How to make WebView to support External CSS RRS feed

  • Question

  • I am using a webview in my app, and i have a few questions

    1) I know that alert() function of CSS is not supported, i want to know what are all the CSS functions are not supported in WebView.

    2) How to make WebView to support External CSS



    Pradeep AJ

    Saturday, June 29, 2013 2:48 AM

Answers

  • Hi Pradeep,

    For (1) refer HTML, CSS, and JavaScript features and differences (Windows Store apps), HTML and DOM API changes list and API changes for Windows 8.1(Windows Store apps using JavaScript and HTML) all of this is applicable to WebView as well.

    For (2) If you are using Local files to show in WebView and you know which CSS, then you can simply download all of it and prefix it with HTML and set it as NavigateToString for WebView. Or may be do this:

    myWebView.NavigateToString("<html><head><link rel='stylesheet' type='text/css' " +
        "href='http://www.w3schools.com/stdtheme.css' /></head><body><br/><br/><br/><br/><br/>" +
        "<p><span class='new' style='float:left;'>New</span>&nbsp;: New in HTML5.</p>"
        + "<iframe src='http://www.w3schools.com' height='500' width='500'></iframe></body></html>");

    Here I am using a CSS present in w3schools to format a span (class='new').

    If this does not help then can you elaborate your requirement ?


    -- Vishal Kaushik --

    Please 'Mark as Answer' if my post answers your question and 'Vote as Helpful' if it helps you. Happy Coding!!!

    • Marked as answer by Pradeep AJ Sunday, March 16, 2014 3:31 AM
    Saturday, March 15, 2014 7:00 PM

All replies