2014-10-14 3 views
-1

웹 사이트 용으로 세 가지 다른 CSS 파일을 만들었습니다. 휴대 기기에서 웹 사이트를 볼 때 올바르게 표시되지 않습니다. 이미지와 텍스트가 겹치고 웹 사이트의 크기가 조정되지 않습니다. 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> 

+1

그것은 당신이 당신보다 앞서있어 쉬운 일이 아니다를 만들기 위해 너무 많은 도움이 될 수있는 Flexbox있다. 코드에서 많은 절대 크기를 볼 수 있습니다 (예 : 상단 : 307px). 이 크기는 뷰포트에 맞게 조정될 수 있도록'% '이어야합니다. 그래서 답은 코드 (많은 노력)를 상대 측정으로 다시 작성하여 태블릿, 휴대 전화, 랩탑 및 점보 해상도 모니터에 맞출 수 있습니다. – chiapa

+3

"안되면 투표를하지 말아주세요. 질문과 같음 " 이것은이 사이트의 작동 방식이 아닙니다. 사람들은 질문을 "좋아하지"않기 때문에 다운 다운하지 않습니다. 다시 묻기 전에 다음을 읽는 것이 좋습니다. http://stackoverflow.com/help/how-to-ask – timo

+0

px를 %로 바꾸면 모바일 버전에 맞출까요? – beginner

답변

0

폭과 높이를 설정하는 %를 사용하여 당신이 % 뷰포트의 크기를 기준으로하기 때문에 찾고있는 접근 방식과에 따라 크기를 적응 그것. 너비/높이를 고정 된 픽셀 수, 예를 들어 500px로 설정하면 모든 뷰포트에서 500px가되어 오버 플로우가 발생하고 레이아웃이 엉망이됩니다. 당신은, 각에서

Relative sizes

수 있습니다

첫 번째 접근 방식 (절대 측정) :

Absolute sizes

상대 조치 여기

두 가지 사례를 가지고있다 브라우저 창을 최소화하고 원하는대로 크기를 조정하십시오. 절대 크기 접근법을 사용하면 div가 화면이 더 작은 경우에도 div가 크기를 유지한다는 것을 알 수 있습니다. 상대 크기 접근법에서는 크기 조정 작업에 맞게 div를 볼 수 있습니다.

지금, 당신의 웹 사이트에이 방법을 재건하고 당신은 당신의 문제를

1

현재 문제가 해결됩니다


당신의 CSS를 꽤 몇 가지 설계 문제가 우선이 있습니다 :

  1. !important 사용 (가능한 한 피해야합니다.)
  2. 크기 조정을 위해 % 대신에 정확히 'pixels (px)'을 사용합니다.
  3. class=""의 사용 (사용에) 인라인 스타일의 사용 (내가 아는이 지금까지 아무것도하지 않습니다)

가능한 대안


에서 'premade'CSS의 용어는 twitter bootstrap을 참조하십시오. 좁은 화면에 'twitter'디자인을 사용하기 때문에이 과정에서 도움이 될 것입니다.

모바일 사이트에 대한 또 다른 가능한 옵션은 사용자의 필요에 따라 devExtreme을 사용하는 것입니다.


가능한 '수정'그러나, 텍스트 크기/등이 문제가 될 수 있으며, 화면 크기의 부분을 취할 것 등 % 폭/사용하는 것보다 다른


. This shows it in practise

overflow 속성을 사용하기 위해 (임시 수정으로) 사용할 수도 있습니다.

는 동적 크기 조정

관련 문제