Recap_Hessian
Recap_Hessian

Reputation: 378

HTML font size not working in the browser on android

I have seen this question, but my goal is to simply view an HTML page correctly in a web browser on Android. Simply put, the .html file contains the following code:

<!DOCTYPE html>
<html>
<head>
<style>a {font-size:25px;}</style>
</head>
<body>
<a href="https://www.google.com/">Some text</a><br>
</body>
</html>

I'm trying to view this file on my phone with the large font size that is set in style. But every browser I have tried changes the font size to normal when loading. I know about the "accessibility" setting, but that doesn't meet my needs as it changes the font size for every page, and is also not big enough.

I have also tried other ways to change font size, such as using font-size property inside <a> tag, <big> tag around the text, and the font size changes accordingly on desktop but android doesn't follow suit. Any help would be appreciated!

Upvotes: 1

Views: 1063

Answers (2)

Ruan
Ruan

Reputation: 17

Try add in the head tag the following meta tag

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Upvotes: 1

Ema
Ema

Reputation: 44

Add <meta name="viewport" content="width=device-width, initial-scale=1"> in your head tag.Read docs here

<!DOCTYPE html>
<html>
 <head>
  <style>a {font-size:25px;}</style>
  <meta name="viewport" content="width=device-width, initial-scale=1">
 </head>
<body>
 <a href="https://www.google.com/">Some text</a><br>
</body>
</html>

Upvotes: 1

Related Questions