Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 移动友好CSS_Javascript_Html_Css_Mobile Website - Fatal编程技术网

Javascript 移动友好CSS

Javascript 移动友好CSS,javascript,html,css,mobile-website,Javascript,Html,Css,Mobile Website,我为一个网站创建了三个不同的CSS文件。当我在移动设备上查看网站时,它没有正确显示。图像和文本重叠,网站未调整大小。 css代码是: <!DOCTYPE html SYSTEM "about:legacy-compat"> <html xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><

我为一个网站创建了三个不同的CSS文件。当我在移动设备上查看网站时,它没有正确显示。图像和文本重叠,网站未调整大小。 css代码是:

<!DOCTYPE html SYSTEM "about:legacy-compat">
<html xml:lang="en" lang="en"><head><meta http-equiv="Content-Type" content="text/html;        charset=UTF-8"><title>GET PAID GUARANTEED</title><meta name="description" content="Work from home and    make at least $1000 your first 30 days after completing the training GUARANTEED or get $500 for trying."><meta name="keywords" content=""><meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="http://www.gr-cdn.com/images/squeeze-page/_external/various/favico.png" rel="shortcut icon"><script type="text/javascript" src="http://info_565.gr8.com/images/common/templates/landing/assets/js/lpc.js"></script><link rel="stylesheet" href="http://info_565.gr8.com/images/common/templates/landing/assets/css/reset.css"><link rel="stylesheet" href="http://info_565.gr8.com/images/common/templates/landing/assets/css/core.css"><link rel="stylesheet" href="http://info_565.gr8.com/images/common/templates/landing/assets/css/webform.css"><link rel="stylesheet" href="http://info_565.gr8.com/images/common/templates/landing/108/1/css/style.css"><script type="text/javascript">
                var REG = {
                    thankyouurl: 'http://info_565.gr8.com/thank_you.html',
                    thankyoutext: 'Thank you!'
                }
            </script><style id="def-mark" type="text/css">html, body { background: none; }
@media only screen and (max-width: 480px)
 { 
     div#edi-00kki .text-content { font-size: 4.57vmin !important; }
     div#edi-455k5 .text-content { font-size: 8.8vmin !important; }
     div#edi-1ik15 .text-content { font-size: 8.8vmin !important; }
     div#edi-999kg .text-content { font-size: 4.57vmin !important; }
     div#edi-59959 .text-content { font-size: 4.57vmin !important; }
     div#edi-l19m1 .text-content { font-size: 5.43vmin !important; }
     div#edi-11l11 .text-content { font-size: 4.57vmin !important; }
     div#edi-99212 .text-content { font-size: 4.57vmin !important; }
     div#edi-ri9ri .text-content { font-size: 5.43vmin !important; }
     div#edi-58818 .text-content { font-size: 4.57vmin !important; }
     div#edi-f2731 button div { font-size: 5.87vmin !important; }
     div#edi-g2gg2 button div { font-size: 5.87vmin !important; }
     div#edi-47ji4 .text-content { font-size: 4.57vmin !important; }
   }
     .gridline.vertical { height: 100%; min-height: 1367px; }
     div#edi-58818 .text-content { line-height: 1.4; font-size: 32px; }
     div#edi-l19m1 .text-content { line-height: 0.8; text-shadow: rgba(0, 0, 0, 0.4) 0px 5px 5px;        }
     div#edi-11l11 .text-content { text-shadow: rgba(255, 255, 255, 0.611765) 0px -1px 2px; line-          height: 1.2; }
     div#edi-g2gg2.buttonhover { border: 0px none rgb(0, 0, 0); box-shadow: rgb(204, 69, 28) 0px  9px 0px 0px; border-top-left-radius: 11px; border-top-right-radius: 11px; border-bottom-left-radius:  11px; border-bottom-right-radius: 11px; background-color: rgb(229, 77, 31); }
     div#edi-g2gg2.buttonhover button div { color: rgb(255, 255, 255); font-weight: normal; font- style: normal; text-decoration: none; }
     div#edi-g2gg2 { border: 0px none rgb(0, 0, 0); box-shadow: rgb(204, 69, 28) 0px 9px 0px 0px;  }
    div#edi-47ji4 .text-content { text-shadow: rgb(0, 0, 0) 0px 1px 2px; }</style><style id="def- mark-hover" type="text/css"></style></head><body><body xmlns="http://www.w3.org/1999/xhtml"  marginwidth="0" marginheight="0" data-twttr-rendered="true" id="body-99lll" data-uid="body-99lll">
   <div hidden="true" id="OPT">
      <form action="#" method="post">
   <div>
      <select name="GoogleWebFont">
      <option value="'Oswald', cursive">
       Oswald:300,400,700:latin,latin-ext
      </option>
      <option value="'Roboto', serif">
        Roboto:300,500,700:latin,latin-ext
      </option>
    </select> <input type="hidden" name="template_id" value="108|1" />
   </div>
  </form>
   </div>
   <section data-section="section" style="height: 1366px; background-image:   url(https://multimedia.getresponse.com/301/5361301/photos/34770001.jpg); background-attachment:   initial; background-color: rgba(0, 0, 0, 0); background-size: cover; background-position: 50% 50%;  background-repeat: no-repeat;" id="section-m51mj" data-uid="section-m51mj" data-bggradient="linear- gradient(to bottom, rgba(0, 0, 0, 0), rgba(251, 233, 172, 1))" class="">
  <div data-section="wrap" data-reverse="true">
  <div data-editable="box" style="top: 377px; left: 297px; width: 402px; height: 34px;   background-color: rgba(255, 255, 255, 0.8);" data-reverse="true" id="edi-8didk" data-uid="edi-8didk"  class=""></div>
  <div data-editable="box" style="top: 411px; left: 172px; width: 657px; height: 36px; background-color: rgba(255, 255, 255, 0.8);" data-reverse="true" id="edi-19889" data-uid="edi-19889" class=""></div>
  <div data-editable="box" style="top: 447px; left: 296px; width: 400px; height: 39px; min-height: 43px; background-color: rgba(255, 255, 255, 0.8);" data-reverse="true" id="edi-17ki1" data-uid="edi-17ki1" class=""></div>
  <div data-editable="text" style="top: 452px; left: 161px; width: 666px; height: 32px;" id="edi-59959" data-uid="edi-59959" class="">
    <div style="color:#0158c6; font-weight:700; font-size:26px;font-family:'Roboto', Helvetica, Arial, sans-serif; text-align:center;" class="text-content">
      Then you are PRE-APPROVED!
    </div>
  </div>
  <div data-editable="text" style="top: 375px; left: 129px; width: 742px; height: 83px;" id="edi-999kg" data-uid="edi-999kg" class="">
    <div style="color:#282828;text-align:center; font-weight:500; font-size:26px;font-family:'Roboto', Helvetica, Arial, sans-serif; line-height:140%;" class="text-content">
      Are you at least 18 years old?<br />
      Do you have access to a reliable internet connection?<br />
    </div>
  </div>
  <div data-editable="box" style="top: 635px; left: 145px; width: 731px; height: 661px; min- height: 390px; background-image: linear-gradient(rgb(244, 200, 49), rgb(251, 233, 172)); background-attachment: scroll; background-color: rgb(255, 255, 255); background-origin: padding-box; background-clip: border-box; background-position: 0% 0%; background-repeat: repeat;" data-reverse="true" id="edi-544a5" data-uid="edi-544a5" data-bggradient="linear-gradient(rgb(244, 200, 49), rgb(251, 233, 172))" class="">
    <div data-editable="box" style="top: -90px; left: -3px; width: 739px; height: 157px; background: url(https://app.getresponse.com/images/common/templates/landing/108/1/img/03.png) 50% 0% no-repeat;" data-reverse="true" id="edi-5m2i5" data-uid="edi-5m2i5" class=""></div>
    <div data-editable="text" style="top: 60px; left: 0px; width: 718px; height: 74px;" id="edi-11l11" data-uid="edi-11l11" class="">
      <div style="color:#fff; font-size:24px; font-family:'Roboto', Helvetica, Arial, sans-serif; text-align:center;" class="text-content">
        <span style="color: rgb(0, 0, 0);"><span style="font-family: Oswald, Helvetica, Arial, sans-serif; font-size: 26px;">Completely fill in the form below,</span></span>
        <div>
          <span style="font-family: Oswald, Helvetica, Arial, sans-serif; font-size: 26px; color: rgb(0, 0, 0);">You will receive an e-mail containing a link to the next step...</span>
        </div>
      </div>
    </div>
    <div data-editable="text" style="top: -70px; left: -16px; width: 756px; height: 134px;" id="edi-l19m1" data-uid="edi-l19m1" class="">
      <div style="color: rgb(255, 255, 255); font-weight: 700; font-size: 50px; font-family: Oswald, Helvetica, Arial, sans-serif; text-align: center;" class="text-content">
        <font size="6" style="font-size: 35px;">Make at least $1,000 within 30 days of completing</font>
        <div>
          <font size="5" style="font-size: 35px;">our step by step training or get paid $500 for trying!</font>
        </div>
      </div>
    </div>
    <div data-editable="webform" style="height: 571px; width: 307px; top: 144px; left: 206px;" id="edi-66eei" data-uid="edi-66eei" class="">
      <form action="" accept-charset="utf-8" method="post" style="width: 307px; height: 571px;">
        <div class="wf-wrap">
          <div class="wf-item type-placeholder" style="top:0;" data-type="text">
            <div class="wf-item-pos" style="left: 0px; max-width: 307px;">
              <div class="label" style="width: 307px;">
                <label style="font-family: Helvetica, Arial, sans-serif; font-size: 20px; line-height: 60px; color: rgb(0, 0, 0); padding: 18px; font-weight: normal; font-style: normal; text-shadow: none;" for="wb-input-61rmm">Your Name</label>
              </div>
              <div style="width: 307px; height: 60px;">
                <input type="text" name="name" style="font-family: Helvetica, Arial, sans-serif; font-size: 20px; color: rgb(0, 0, 0); border: 3px solid rgb(236, 240, 242); padding: 0px 8px; font-weight: normal; font-style: normal; background: rgb(255, 255, 255);" autocomplete="off" id="wb-input-61rmm" />
              </div>
            </div>
          </div>
          <div class="wf-item type-placeholder" style="top:84px;" data-type="text">
            <div class="wf-item-pos" style="left: 0px; max-width: 307px;">
              <div class="label" style="width: 307px;">
                <label style="font-family: Helvetica, Arial, sans-serif; font-size: 20px; line-height: 60px; color: rgb(0, 0, 0); padding: 18px; font-weight: normal; font-style: normal; text-shadow: none;" for="wb-input-nnn61">Your Email</label>
              </div>
              <div style="width: 307px; height: 60px;">
                <input type="text" name="email" style="font-family: Helvetica, Arial, sans-serif; font-size: 20px; color: rgb(0, 0, 0); border: 3px solid rgb(236, 240, 242); padding: 0px 8px; font-weight: normal; font-style: normal; background: rgb(255, 255, 255);" autocomplete="off" id="wb-input-nnn61" />
              </div>
            </div>
          </div>
          <div class="wf-item type-placeholder" style="top: 168px;" data-type="text">
            <div class="wf-item-pos" style="left: 0px; max-width: 307px;">
              <div class="label" style="width: 307px;">
                <label style="font-family: Helvetica, Arial, sans-serif; font-size: 20px; line-height: 60px; color: rgb(0, 0, 0); padding: 18px; font-weight: normal; font-style: normal; text-shadow: none;" for="wb-input-1xx1x">Phone Number</label>
              </div>
              <div style="width: 307px; height: 60px;">
                <input type="text" name="custom_PhoneNumber" value="" style="font-family: Helvetica, Arial, sans-serif; font-size: 20px; color: rgb(0, 0, 0); border: 3px solid rgb(236, 240, 242); padding: 0px 8px; font-weight: normal; font-style: normal; background: rgb(255, 255, 255);" autocomplete="off" id="wb-input-1xx1x" />
              </div>
            </div>
          </div>
          <div class="wf-item" style="top: 224px;" data-type="radio">
            <div class="wf-item-pos" style="left: 3px; max-width: 307px;">
              <div class="label" style="width: 307px;">
                <label style="font-family: Helvetica, Arial, sans-serif; font-size: 21px; line-height: 60px; color: rgb(0, 0, 0); padding: 0px 0px 6px; font-weight: normal; font-style: normal; text-shadow: none;" for="Howmanyhourscanyouworkfromhomeea-0"># of hours you can work weekly:</label>
              </div>
              <div style="width: 307px; height: 60px;">
                <label for="Howmanyhourscanyouworkfromhomeea-0" style="white-space: nowrap; width: 13px;"><input type="radio" id="Howmanyhourscanyouworkfromhomeea-0" name="custom_Howmanyhourscanyouworkfromhomeea" value="1-5" autocomplete="off" style="font-size: 20px; padding: 0px 21px;" /> 1-5</label> <label for="Howmanyhourscanyouworkfromhomeea-1" style="white-space:nowrap;"><input type="radio" id="Howmanyhourscanyouworkfromhomeea-1" name="custom_Howmanyhourscanyouworkfromhomeea" value="11-20" /> 11-20</label> <label for="Howmanyhourscanyouworkfromhomeea-2" style="white-space:nowrap;"><input type="radio" id="Howmanyhourscanyouworkfromhomeea-2" name="custom_Howmanyhourscanyouworkfromhomeea" value="21-30" /> 21-30</label> <label for="Howmanyhourscanyouworkfromhomeea-3" style="white-space:nowrap;"><input type="radio" id="Howmanyhourscanyouworkfromhomeea-3" name="custom_Howmanyhourscanyouworkfromhomeea" value="6-10" /> 6-10</label>
              </div>
            </div>
          </div>
          <div class="wf-item type-placeholder" style="top: 398px;" data-type="text">
            <div class="wf-item-pos" style="left: 1px; max-width: 307px;">
              <div class="label" style="width: 307px;">
                <label style="font-family: Helvetica, Arial, sans-serif; font-size: 20px; line-height: 60px; color: rgb(0, 0, 0); padding: 18px; font-weight: normal; font-style: normal; text-shadow: none;" for="wb-input-s11b6">Date You Are Available To Start</label>
              </div>
              <div style="width: 307px; height: 60px;">
                <input type="text" name="custom_data_DateYouAreAvailableToStart" value="" style="font-family: Helvetica, Arial, sans-serif; font-size: 20px; color: rgb(0, 0, 0); border: 3px solid rgb(236, 240, 242); padding: 0px 8px; font-weight: normal; font-style: normal; background: rgb(255, 255, 255);" autocomplete="off" id="wb-input-s11b6" />
              </div>
            </div>
          </div>
          <div class="wf-item" style="top: 478px;" data-type="submit">
            <div class="wf-item-pos" style="left: 5px; max-width: 210px;">
              <div style="width: 298px; height: 68px;">
                <button type="submit" value="Sign up now!" id="wb-button-ero16" style="font-size: 36px; padding: 0px 13px; border: 5px none rgb(255, 255, 255); box-shadow: rgb(20, 0, 130) 0px 5px 1px 2px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; background-image: none; background-color: rgba(43, 55, 237, 0.901961);">
                <div>
                  Send Me More Info!
                </div></button>
              </div>
            </div>
          </div>
        </div>
      </form>
    </div>
  </div>
  <div data-editable="box" style="top: 198px; left: 172px; width: 663px; height: 154px; background: url(https://app.getresponse.com/images/common/templates/landing/108/1/img/08.png) 50% 0% no-repeat;" data-reverse="true" id="edi-65641" data-uid="edi-65641" class=""></div>
  <div data-editable="box" style="top: 69px; left: 127px; width: 672px; height: 168px; min-height: 277px; background: url(https://app.getresponse.com/images/common/templates/landing/108/1/img/02.png) 50% 0% / 635px no-repeat scroll padding-box border-box rgba(0, 0, 0, 0);" data-reverse="true" id="edi-4kb95" data-uid="edi-4kb95" data-bggradient="linear-gradient(to bottom, rgba(26, 110, 18, 1), rgba(0, 0, 0, 1))" class="">
    <div data-editable="text" style="top: 151px; left: 50px; width: 649px; height: 114px;" id="edi-1ik15" data-uid="edi-1ik15" class="">
      <div style="color:#fff; font-size:81px;font-family:'Oswald',Helvetica, Arial, sans-serif; line-height:110%; text-align:center;text-shadow: rgba(0,0,0,.4) 0 5px 5px;" class="text-content">
        <font size="6" style="font-size: 70px;"><font>FOR GUARANTEED PAY</font> !</font>
      </div>
    </div>
    <div data-editable="text" style="top: 26px; left: 21px; width: 624px; height: 110px;" id="edi-455k5" data-uid="edi-455k5" class="">
      <div style="color:#fff;text-align:center; font-size:81px;font-family:'Oswald',Helvetica, Arial, sans-serif; line-height:120%;text-align:center;text-shadow: rgba(0,0,0,.4) 0 5px 5px;" class="text-content">
        WORK FROM HOME
      </div>
    </div>
  </div>
  <div data-editable="text" style="width: 727px; height: 21px; top: 1337px; left: 151px;" id="edi-47ji4" data-uid="edi-47ji4" class="">
    <div style="text-align: center; font-size: 18px; font-family: Helvetica, sans-serif; color: rgb(0, 0, 0);" class="text-content">
      <span style="color: rgb(255, 255, 255);">We hate SPAM too! We would never share your personal information.</span>
    </div>
  </div>
</div>

保证得到报酬
var REG={
谢谢URL:'http://info_565.gr8.com/thank_you.html',
谢谢文字:“谢谢你!”
}
html,正文{背景:无;}
@仅介质屏幕和(最大宽度:480px)
{ 
div#edi-00kki.text内容{字体大小:4.57vmin!重要;}
div#edi-455k5.文本内容{字体大小:8.8vmin!重要;}
div#edi-1ik15.文本内容{字体大小:8.8vmin!重要;}
div#edi-999kg.文本内容{字体大小:4.57vmin!重要;}
div#edi-59959.文本内容{字体大小:4.57vmin!重要;}
div#edi-l19m1.文本内容{字体大小:5.43vmin!重要;}
div#edi-11l11.文本内容{字体大小:4.57vmin!重要;}
div#edi-99212.文本内容{字体大小:4.57vmin!重要;}
div#edi-ri9ri.文本内容{字体大小:5.43vmin!重要;}
div#edi-58818.文本内容{字体大小:4.57vmin!重要;}
div#edi-f2731按钮div{字体大小:5.87vmin!重要;}
div#edi-g2gg2按钮div{字体大小:5.87vmin!重要;}
div#edi-47ji4.文本内容{字体大小:4.57vmin!重要;}
}
.gridline.vertical{高度:100%;最小高度:1367px;}
div#edi-58818.文本内容{行高:1.4;字体大小:32px;}
div#edi-l19m1.文本内容{行高:0.8;文本阴影:rgba(0,0,0,0.4)0px 5px 5px;}
div#edi-11l11.文本内容{文本阴影:rgba(255,255,255,0.611765)0px-1px 2px;行高:1.2;}
div#edi-g2gg2.buttonhover{边框:0px无rgb(0,0,0);方框阴影:rgb(204,69,28)0px 9px 0px 0px 0px;边框左上半径:11px;边框右上半径:11px;边框左下半径:11px;边框右下半径:11px;背景色:rgb(229,77,31)}
div#edi-g2gg2.buttonhover按钮div{颜色:rgb(255,255,255);字体大小:正常;字体样式:正常;文本装饰:无;}
div#edi-g2gg2{边框:0px无rgb(0,0,0);方框阴影:rgb(204,69,28)0px 9px 0px 0px;}
div#edi-47ji4.文本内容{文本阴影:rgb(0,0,0)0px 1px 2px;}
奥斯瓦尔德:300400700:拉丁语,拉丁语分机
机器人:300500700:拉丁语,拉丁语分机
那么你是预先批准的!
你至少18岁吗?
您有可靠的internet连接吗?
完整填写下表, 您将收到一封电子邮件,其中包含指向下一步的链接。。。 完成后30天内至少赚1000美元 我们的循序渐进的培训或获得500美元的报酬! 你的名字 你的电子邮件 电话号码 #您每周可以工作的小时数: 1-5 11-20 21-30 6-10 您可以开始的日期 给我更多的信息! 保证工资! 在家工作 我们也讨厌垃圾邮件!我们永远不会共享您的个人信息。

使用
%
设置宽度和高度是您正在寻找的方法,因为
%
与视口大小相关,并根据视口大小调整其大小。当您将宽度/高度设置为固定数量的像素(例如500px)时,任何视口中的宽度/高度都将为500px,这会导致您提到的溢出并扰乱布局

这里有两个例子:

您的第一种方法(绝对测量):

以及相关措施:

在每种情况下,您都可以最小化浏览器窗口并随意调整其大小。您将看到,使用绝对大小方法时,div保持其大小,即使屏幕比div小。在相对大小方法中,可以看到div适应调整大小操作

现在,以这种方式重建您的网站,您将修复您的问题


当前问题
对于初学者来说,css有很多设计问题:

  • 使用
    !重要信息
    (应尽量避免)
  • 使用精确的“
    像素(px)
    ”而不是
    %
    ”来调整大小
  • 内联样式的使用(过度使用)
  • 使用
    class=”“
    (据我所知,这没有任何作用)

  • 可能的替代方案
    就“预制”css而言,请查看,这将有助于这一过程,因为它使用“推特”设计实现窄屏幕

    移动站点的另一个可能的选择是使用它也可以满足您的需要


    可能的“修复”
    除此之外,使用
    %
    宽度/etc将占据屏幕大小的一部分,但是,您的文本大小/etc可能会变成一个p