How can I make an html page automatically suitable for mobile device screens?

I put a Formableable Form on an html page with <iframe>, but I would like it to be full screen on a mobile device. So far I am using the following code:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <style>
  @import url(http://fonts.googleapis.com/css?family=Londrina+Sketch);

  body {
  background-color: #f3eedd;
  width: 750px;
  overflow:scroll;
    overflow-x:hidden;
  }

h2 {
    font-size: 20px;
    color: #c13e18;
    margin: 10px 30px 10px 30px;
}

</style>
</head>
<body>
<div id="header">
<h2>Book Supheroes Unite</h2>
</div>
<div id="form">
<iframe src="http://challenge-the-box.com/wp-admin/admin-ajax.php?action=frm_forms_preview&form=sbyrt02
" frameborder="0" scrolling="no" style="width:280px;height:535px;"></iframe></div>
</html>

I think this is due to viewports? However, I am not entirely sure about this!

+4
source share
3 answers
<meta name="viewport" content="width=device-width, initial-scale=1.0">

This meta tag allows you to target mobile devices and set the screen width.

The documentation provided here!

CSS -! Twitter Bootstrap

+10

, ​​ bootstrap, , - .

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

Bootstrap . divs , :

<div class="container-fluid">
<div class="row">
    ...
  </div>
</div>
+1

media queries! :

@media (max-width: 640px) {
  //your css to make it full screen
}
-2

Source: https://habr.com/ru/post/1608990/


All Articles