打印Xcode的内容

时间:2015-03-25 15:58:04

标签: html printing

这是HTLM代码。我们点击ctrl + P打印,我们可以在一页上查看。但是当我们在Xcode的Webview控制器上查看它时。它显示在2页。任何想法都有助于我们下面的html内容

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta charset="utf-8" />
  <title>StoryLeather</title>
  <style>
    body {
      width: 100%;
      /*background-color:green;*/
      margin: 0px;
    }
    #top-div {
      width: 100%;
    }
    #bottom-div {
      width: 100%;
      /*margin-top:40px;*/
    }
    .left-div {
      float: left;
      width: 45%;
      /*background-color:pink;*/
      margin-left: 5%;
    }
    .right-div {
      float: right;
      width: 45%;
      /*background-color:blue;*/
      margin-right: 5%;
      text-align: center;
    }
    .text {
      font-family: '微軟正黑體';
    }
    .number {
      font-size: 35px;
      margin-top: 20px;
    }
    .big-div {
      width: 100%;
      /*margin-top:30px;*/
    }
    .button {
      width: 100%;
      height: 40px;
      margin-top: 10px;
    }
    .title-1 {
      background-color: black;
      width: 35%;
      float: left;
      border: none;
      height: 29px;
      color: white;
      padding-top: 15px;
      font-size: 13px;
    }
    #text-6 {
      background-color: white;
      width: 50%;
      float: right;
      height: 30px;
    }
    .line2 {
      background-color: #a1a1a1;
      height: 1px;
      width: 100%;
      margin-top: 10px;
    }
    .label {
      margin-top: 30px;
      font-size: 13px;
      text-align: left;
    }
    .txt {
      margin-top: 20px;
    }
    .img-f {
      width: 50%;
      float: left;
      text-align: left;
      margin-top: 15px;
    }
    .sign-r {
      width: 50%;
      float: right;
      margin-top: 15px;
    }
    .line3 {
      margin-top: 25px;
      width: 100%;
      height: 1px;
      background-color: black;
    }
    .copy-text {
      float: right;
      /*margin-top:50px;*/
      margin-right: 5%;
      font-family: 'Microsoft JhengHei';
      width: 45%;
      text-align: right;
      font-size: 5px;
    }
    .sizefont10 {
      font-size: 10px;
    }
    .txt-right {
      text-align: center;
      font-weight: bold;
    }
    .footer {
      font-size: 10px;
      width: 100%;
      margin-top: 30px;
    }
    .left-footer {
      float: left;
      /*margin-top:50px;*/
      margin-left: 5%;
      font-family: 'Microsoft JhengHei';
      width: 45%;
    }
    .text-7 {
      font-size: 13px;
    }
    .line {
      height: 2px;
      width: 100%;
      background-color: black;
    }
    .img-Phone {
      margin-top: 15px;
    }
  </style>
</head>

<body>
  <div id="top-div">
    <div class="left-div">
      <div id="div-logo">
        <img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSIkkJlwgDZDonmGAYOJgB0_895j4ocX-9gCxgLc90rLgOJHaNA" class="img-logo" style="max-height:50px;" />
      </div>
      <div class="text" style="font-weight:bold; /*margin-top:40px;*/ margin-top:10px; font-size:20px;">
        STYLE 5C2
      </div>
      <div style="font-family:微軟正黑體; /*margin-top:20px;*/margin-top:10px; font-size:15px;">
        ­ IPhone 5C 硬殼式下蓋 客製化皮套
      </div>
      <div id="text-4" class="text" style="margin-top:10px;font-size:11px; width:100%;">
        <div id="text-4-left" style="width:20%; float:left;">
          - 外部皮料
          <br/>- 備註
          <br/>- 烙印選項
        </div>
        <div id="text-4-right" style="width:80%;float:left;">
          十字紋 / A37-十字紋淺米白
          <br/>[無填寫]
          <br/>無需
        </div>
      </div>
      <div style="clear:both;"></div>
      <div class="img-Phone" style="width:100%;">
        <img style="max-width:30%; float:left;" src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSIkkJlwgDZDonmGAYOJgB0_895j4ocX-9gCxgLc90rLgOJHaNA" />
        <img style="max-width:30%; float:right; margin-right:20%;" src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSIkkJlwgDZDonmGAYOJgB0_895j4ocX-9gCxgLc90rLgOJHaNA" />
      </div>
    </div>
    <div class="right-div">
      <div id="div1">
        <div class="text" style="margin-top:10px;font-size:15px;">
          CUSTOM ORDERS
        </div>
        <div class="number" style="/*margin-top:30px;*/">
          <div id="text-2" class="text" style="font-family:'Microsoft JhengHei';">
            20140912
          </div>
          <div class="line">
          </div>
          <div id="text-3" class="text" style="font-family:'Microsoft JhengHei';">
            A140912001
          </div>
          <div class="big-div">
            <div class="button">
              <div class="title-1">
                客戶資訊
              </div>
            </div>
            <div class="label">
              <div class="label1">
                <div class="txt">
                  姓名
                </div>
                <div class="line2">
                </div>
              </div>
              <div class="label2">
                <div class="txt">
                  電話
                </div>
                <div class="line2">
                </div>
              </div>
              <div class="label3">
                <div class="txt">
                  地址
                </div>
                <div class="line2">
                </div>
              </div>
            </div>
            <div class="sign">
              <div class="img-f">
                <img src="img2.png" style="width:40%;" />
              </div>
              <div class="sign-r">
                <div class="text-7">訂購人確認 \/</div>
                <div class="line3"></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div style="clear:both;"></div>
  <div class="footer">
    <div class="left-footer">
      - 經銷存聯 - 訂做商品下單後約30 天交件
    </div>
    <div class="copy-text">
      COPYRIGHT 2014 PTOW KING CO. LTD ALL RIGHTS RESEARVED
    </div>
  </div>
  <div style="clear:both;background-color:black; height:1px;"></div>
  <div id="bottom-div">
    <div class="left-div">
      <div id="div-logo-2">
        <img src="logo.png" class="img-logo" style="max-height:50px;" />
      </div>
      <div class="text" style="font-weight:bold;/* margin-top:40px;*/ margin-top:10px; font-size:20px;">
        STYLE 5C2
      </div>
      <div style="font-family:微軟正黑體;/* margin-top:20px;*/margin-top:10px; font-size:15px;">
        ­ IPhone 5C 硬殼式下蓋 客製化皮套
      </div>
      <div id="text-4-2" class="text" style="margin-top:10px; font-size:11px;">
        <div id="text-left-4-2" style="width:20%; float:left;">
          - 外部皮料
          <br/>- 備註
          <br/>- 烙印選項
        </div>
        <div id="text-right-4-2" style="width:80%;float:left;">
          十字紋 / A37-十字紋淺米白
          <br/>[無填寫]
          <br/>無需
        </div>
      </div>
      <div style="clear:both;"></div>
      <div class="img-Phone" style="width:100%;background-color:yellow;">
        <img style="max-width:30%; float:left;" src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSIkkJlwgDZDonmGAYOJgB0_895j4ocX-9gCxgLc90rLgOJHaNA" />
        <img style="max-width:30%; float:right; margin-right:20%;" src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSIkkJlwgDZDonmGAYOJgB0_895j4ocX-9gCxgLc90rLgOJHaNA" />
      </div>
    </div>
    <div class="right-div">
      <div id="div9">
        <div class="text" style="/*margin-top:20px;*/ font-size:15px;">
          CUSTOM ORDERS
        </div>
        <div class="number" style="/*margin-top:30px;*/">
          <div id="text-2-2" class="text" style="font-family:'Microsoft JhengHei';">
            20140912
          </div>
          <div class="line">
          </div>
          <div id="text-3-2" class="text" style="font-family:'Microsoft JhengHei';">
            A140912001
          </div>
          <div class="big-div">
            <div class="button">
              <div class="title-1">
                經銷商資訊
              </div>
            </div>
            <div class="label">
              <div class="label1">
                <div id="big-text" style="width:100%; margin-top:25px;">
                  <div class="txt-left" style="float:left;">
                    門市名稱
                  </div>
                  <div class="txt-right">
                    神腦西門武昌店
                  </div>
                </div>
                <div style="clear:both;"></div>
                <div class="line2">
                </div>
              </div>
              <div class="label2">
                <div id="big-text-2" style="width:100%; margin-top:25px;">
                  <div class="txt-left" style="float:left;">
                    聯絡電話
                  </div>
                  <div class="txt-right">
                    02-23610707
                  </div>
                </div>
                <div style="clear:both;"></div>
                <div class="line2">
                </div>
              </div>
              <div class="label3">
                <div id="big-text-3" style="width:100%; margin-top:25px;">
                  <div class="txt-left" style="float:left;">
                    聯絡地址
                  </div>
                  <div class="txt-right">
                    台北市萬華區武昌街2段58號
                  </div>
                </div>
                <div style="clear:both;"></div>
                <div class="line2">
                </div>
              </div>
            </div>
            <div class="sign">
              <div class="img-f">
                <img src="img2.png" style="width:40%;" />
              </div>
              <div class="sign-r">
                <div class="text-7">經辦人確認 \/</div>
                <div class="line3"></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div style="clear:both;"></div>
  <div class="footer">
    <div class="left-footer">
      - 客戶存聯 - 訂做商品下單後約30 天交件
    </div>
    <div class="copy-text">
      COPYRIGHT 2014 PTOW KING CO. LTD ALL RIGHTS RESEARVED
    </div>
  </div>
</body>

</html>

请检查所有

1 个答案:

答案 0 :(得分:0)

它是这样显示的,因为x-code的web视图比计算机屏幕要小得多,所以要替换它格式并注册它并使它成为2页,没有什么奇怪的,它只是它的方式是