Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android WebView font size in pixels

I'd like to set the font size I'm using in a WebView to a specific pixel size. I'm doing something along the lines of

<p style="font-size: 18px">Text</p>

However, the size of the font is different on different devices. Any idea how to make this work?

Thanks!

like image 534
Joris Weimar Avatar asked Oct 01 '12 13:10

Joris Weimar


1 Answers

The solution I found was adding the following meta tag to the HTML

 <meta name=\"viewport\" content=\"target-densitydpi=device-dpi\" />
like image 82
Joris Weimar Avatar answered Sep 22 '22 09:09

Joris Weimar