title: Define style to HTML for webView in Android
body: <p>I want to populate webView with HTML by using the following:</p>
  <pre><code>String str = &quot;&lt;html&gt;&quot; +
          &quot;&lt;body&gt;&quot; +
          &quot;&lt;style&gt; \n&quot; +
              &quot;h3 {\&quot;font-family:helvetica,arial,sans-serif;font-size:24px;line-height:1.3;\&quot;} \n&quot; +
              &quot;p {\&quot;font-family:helvetica,arial,sans-serif;font-size:12px;line-height:1.3;\&quot;} \n&quot; +
          &quot;&lt;/style&gt; \n&quot; +
          &quot;&lt;h3&gt; Open-Source licenses&lt;/h3&gt;\n&quot; +
          &quot;&lt;p&gt; A huge thanks from all of us at to the great people behind the great programs listed below.&lt;/p&gt;\n&quot; +
          &quot;&lt;ul&gt;\n&quot; +
          &quot;&lt;li&gt;Asynchronous Http Client for Android&lt;/li&gt;\n&quot; +
          &quot;&lt;li&gt;Glide&lt;/li&gt;\n&quot; +
          &quot;&lt;li&gt;Google Play Service&lt;/li&gt;\n&quot; +
          &quot;&lt;li&gt;Gson&lt;/li&gt;\n&quot; +
          &quot;&lt;li&gt;Picasso&lt;/li&gt;\n&quot; +
          &quot;&lt;/ul&gt;\n&quot; +
          &quot;&lt;hr&gt;&quot; +
          &quot;&lt;h3&gt;Asynchronous Http Client for Android&lt;/h3&gt;\n&quot; +
          &quot;&lt;p&gt;&lt;a href=\&quot;https://github.com/android-async-http/android-async-http\&quot;&gt;https://github.com/android-async-http/android-async-http&lt;/a&gt;&lt;/p&gt; \n&quot; +
          &quot;&lt;p&gt;Unless required by applicable law or agreed to in writing, software&lt;br&gt;distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,&lt;br&gt;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br&gt;See the License for the specific language governing permissions and&lt;br&gt;limitations under the License.&lt;/p&gt;\n&quot; +
          &quot;&lt;/body&gt;&lt;/html&gt;&quot;;
  
  wb_OpenSource.loadDataWithBaseURL( null, str, &quot;text/html&quot;, &quot;utf-8&quot;, null );
  </code></pre>
  <p>However, it seems like the style does not make any difference.</p>
  <p>Any way to make it work instead of adding style to each line?</p>
  <p>UPDATE:</p>
  <p>As was suggest below, I created a .css file that looks as follows:</p>
  <pre><code>#topHeader {
      font-family:helvetica,arial,sans-serif;font-size:24px;line-height:1.3;
  }
  
  #regHeader {
      font-family:helvetica,arial,sans-serif;font-size:20px;line-height:1.3;
  }
  
  #topText {
      font-family:helvetica,arial,sans-serif;font-size:14px;line-height:1.3;
  }
  
  #regText {
      font-family:helvetica,arial,sans-serif;font-size:12px;line-height:1.3;
  }
  
  #links {
      font-family:helvetica,arial,sans-serif;font-size:16px;line-height:1.3;
  }
  </code></pre>
  <p>And changed my HTML to be:</p>
  <pre><code>&quot;&lt;body&gt;&quot; +
  &quot;&lt;link rel=\&quot;stylesheet\&quot; href=\&quot;cssStyles.css\&quot;&gt; \n&quot; +
  &quot;&lt;h3 id=\&quot;topHeader\&quot;&gt; Open-Source licenses&lt;/h3&gt;\n&quot; +
  &quot;&lt;p id=\&quot;topText\&quot;&gt; A huge thanks from all of us at to the great people behind the great programs listed below&lt;/p&gt;\n&quot; +
  &quot;&lt;ul&gt;\n&quot; +
  &quot;&lt;li id=\&quot;regText\&quot;&gt; Asynchronous Http Client for Android &lt;/li&gt;\n&quot; +
  &quot;&lt;li id=\&quot;regText\&quot;&gt; ExpandableTextView Android Arsenal &lt;/li&gt;\n&quot; +
  </code></pre>
  <p>and</p>
  <pre><code>wb_OpenSource.loadDataWithBaseURL( &quot;file://android_asset/cssStyles.css&quot;, str, &quot;text/html&quot;, &quot;utf-8&quot;, null );
  </code></pre>
  <p>But it doesn't seem to work.</p>
  <p>Thank you</p>