css - How to make centered fixed width body responsive? -


i have simple css layout, restrict body width , center on screen:

body { max-width: 38em; margin: auto; } 

i expected responsive: on huge screens lines stay short , body centered, on small screens body take hold of of screen can get. works in web browser's "responsive design view". on mobile devices, page displayed if huge screen: tiny text, big margins on side. how can tell mobile browsers stop behaving stupid?

you need specify viewport width when working mobile browsers.

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

read more: mdn


Comments

Popular posts from this blog

c - Calling a function within a loop -

vb.net - Unbound DataGridView add row with checkbox error -

How i fill combobox items in Radgridview manually using in vb.net -