0

How to make website (made by using HTML and CSS only) fit to size in mobile without bootstrap?

I have tried using the following tag in HTML :-

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

I want to know whether I have to write a code in CSS too to help achieve my goal.

Thanks in advance !

Lalji Tadhani
  • 14,041
  • 3
  • 23
  • 40
  • Possible duplicate of [How can I make an html page automatically fit mobile device screens?](http://stackoverflow.com/questions/32782454/how-can-i-make-an-html-page-automatically-fit-mobile-device-screens) – Lalji Tadhani Aug 25 '16 at 10:09

2 Answers2

0

To make your website scale to the actual width of the device it is displayed on, you need to scale the elements of the page accordingly.

If you for example don't specify the width of a picture, it will always be displayed at full width.

You need to scale all elements so that the together are not wider (maybe also higher) than the site viewport of the site. Therfore, you will absolutely need to use CSS.

Because this is difficult, frameworks like Bootstrap exist.

morre
  • 152
  • 10
-1

You don't need to use bootstrap to make a responsive site, you just need to use gridsystem or make your one.

The most important action is to replace fixed sizes by percentages and work with maximums sizes

This could help you:

https://1200px.com/

http://www.responsivegridsystem.com/

http://v4-alpha.getbootstrap.com/layout/grid/

  • Instead of posting links to a handful of sites, any of which could break, you should post the salient points to your answer. – j08691 Aug 25 '16 at 13:02
  • Sorry, "make website (made by using HTML and CSS only) fit to size in mobile" means a wide range of elements that should be considered. And the best way to make this is learning how to use a grid system. In short, the most important action is to replace fixed sizes by percentages and work with maximums sizes. – Sofia Ferreira Aug 25 '16 at 13:35