title: Include CSS within WebView in Xamarin Forms with a Source URL (iOS & Android)
body: <p>I am trying to include some custom css within a webview on xamarin forms so the website being used can be customized with css styles, changing colors or other css style classes.</p>
  
  <p>I have done this before using native code in Xcode and Android Studio, however this project is using xamarin forms and visual studio. </p>
  
  <p>I believe what we need to do is include css within a custom webview renderer for android and ios. (would not be surprised if there was an easier way).</p>
  
  <p>I have tried various methods being shown online and can not find a solution. Searching online there are some methods however they are not for xamarin forms. </p>
  
  <p>Below is a snippet of my xaml:</p>
  
  <pre><code>&lt;WebView x:Name="WebView" Source="https://odapps.org/" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Navigating="WebViewTesti_OnNavigating"/&gt;
  </code></pre>
  
  <p>Another snippet of my xaml.cs:</p>
  
  <pre><code>public WebViewPage()
          {
              InitializeComponent();
              CheckConnectivity();
              WebView.Navigated += WebView_Navigated;
          }
  </code></pre>
  
  <p>I am trying to have inline css styles load while using an external source url like google.com.</p>
  
  <p>For those curious, this is how I have done it in xcode and android studio, but need it for Xamarin Forms: </p>
  
  <p>Xcode:</p>
  
  <pre><code>ViewControllers file within xCode
  
  let cssString = "*:not(input):not(textarea) { -webkit-user-select: none; -webkit-touch-callout: none; } footer{display:none;}"
  </code></pre>
  
  <p>Android Studio:</p>
  
  <pre><code>public void onPageFinished(WebView view, String url)
  
  view.loadUrl("javascript: $('.footer,#sg-smartbanner').css('display','none')");
  </code></pre>