css - HTML site doing weird optimization once published? -


i published site earlier today , noticed few things different when , running. coded looked like

enter image description here

and looked when pulled site on phone

enter image description here

there few things wrong when pulled on computer, making me question if these optimization problems.... i'll leave code below if can me keep aspects of site in 1 place no matter viewing device amazing!

html index code

<!doctype html> 

<head>      <title>p2 fitness company</title>     <link rel="stylesheet" type="text/css" href="style.css">  </head>  <body>     <center>         <div id = "headerbg"></div>         <div class = "header">             <h1>free pdf 7 tips boost <br>your progress in gym</h>         </div>         <div id = "logo">             <img src = "img/p2fitnesstransparent.png" width = "350px" height = "150px">         </div>         <div id = "inputbg"></div>          <div class = "input">             <form method = "get" action = "files/7tips.pdf">                 <input type = "text" name = "first" size = "15">                  <input type = "text" name = "last" size = "15"> <br> <br>                 <input type = "text" name = "email" size = "20"> <br> <br>                 <input id = "enterbtn" type = "submit" value = "download">             </form>         </div>          <div class = "pdfdisplay">             <img src = "img/pdfdisplay.png" height = "400px" width = "400px">         </div>         <h5 id = "firsttxt">first*</h5>         <h5 id = "lasttxt">last*</h5>         <h5 id = "emailtxt">email*</h5>          <img src = "img/downloadhere.png" id = "downloadhere">      </center>      <div id = "benefits">         <h2>benefits of pdf</h2>          <h3>-utilize the time are<br>already spending in gym</br>         -learn new ways gain muscle</br>         -learn live healthier lifestyle</br>         -reduce risk of injury</h3>     </div>  </body> 

css code

@font-face { font-family: "my custom font"; src: url(fonts/font.ttf) format("truetype"); }  body { background: url(img/bg.png) no-repeat center center fixed;  -webkit-background-size: cover; -moz-background-size: cover; o-background-size: cover; background-size: cover;  font-family: "my custom font", times, serif;  max-width: 100%; overflow-x: hidden; }  #headerbg { height: 450px; width: 710px; background-color: rgb(28, 28, 28); position: relative; top: 100px; border-radius: 15px; opacity: 0.6; }  .header  { position: relative; bottom: 345px; color: white; padding-right: 30px; }  #logo { position: relative; bottom: 605px; right: 210px; }  #inputbg { width: 375px; height: 550px; background-color: rgb(28, 28, 28); position: relative; left: 168px; bottom: 150px; border-radius: 15px; opacity: 0.6; }  .input { color: white; text-align: center; position: relative; bottom: 320px; left: 170px; }  #firsttxt { position: relative; bottom: 900px; left: 45px; color: white; }  #lasttxt { position: relative; bottom: 938px; left: 187px; color: white; }  #emailtxt { position: relative; bottom: 933px; left: 103px; color: white; }  #downloadhere { position: relative; bottom: 1512px; left: 169px; }  #enterbtn  { width: 135px; height: 50px; color: rgb(186, 209, 225); background-color: rgb(203, 38, 38); border-color: rgb(203, 38, 38); font-size: 20px; position: relative; text-align: center;  }  #benefits { position: relative; bottom: 1900px; color: white; text-align: center; }  .pdfdisplay { position: relative; bottom: 860px; left: 175px; } 

the main problem have hard-coded dimensions using px. page not responsive. if want make work have make responsive different viewports.
bootstrap option making pages responsive. also, can make responsive exploiting vw,vh , vmin properties.
link w3schools might well.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -