Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Website displaying strangley on mobile when using Bootstrap

I am creating an admin area using Bootstrap. When I resize my screen via dragging it and making it smaller, the website looks exactly how I would expect:

enter image description here

However when I view it on mobile it zooms out and looks like it tries to show the whole screen. Like below

enter image description here

Has anyone experianced this issue before with Bootstrap? I'm thinking it could be a Javascript issue where it doesn't detect the size of the browser?

like image 711
Elliot Pohath Avatar asked Jan 17 '26 22:01

Elliot Pohath


1 Answers

Use

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

in the <head> section of your HTML document.

This means that the browser will (probably) render the width of the page at the width of its own screen.

— Chris Coyer on CSS-Tricks

You can check MDN for more information about the viewport meta tag and its usage.

like image 62
andreas Avatar answered Jan 19 '26 11:01

andreas



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!