Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set different font sizes depending on the screen size in Angular Material?

Im trying to optimize my Angular Material landingpage for mobile devices.

Is there a way to have different font sizes for the headline depending on the screen size without writing custom css?

In this example h1 with md-display-3 would be too large on mobile devices:

<h1 class="center white md-display-3">This is a headline</h1>
like image 1000
Rene Füchtenkordt Avatar asked Dec 02 '25 17:12

Rene Füchtenkordt


1 Answers

To adjust your font size according to your browser, add this meta tag to your document.

<meta name="viewport" content="width=device-width, initial-scale=1">
like image 111
Sarat Chandra Avatar answered Dec 04 '25 19:12

Sarat Chandra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!