【问题标题】:How to insert labels on an image and then print the page如何在图像上插入标签然后打印页面
【发布时间】:2014-02-25 18:20:49
【问题描述】:

我有一个 aspx 页面,并在其中放置一个 100% 宽度和高度的 div 中的图像以及用于显示文本的几个标签,在 Visual Studio 上,asp.net 页面...在设计模式下显示标签和为背景设置图像,但在运行时不显示文本。我该怎么办? 这是我的代码:

<head runat="server">
    <title></title>
        <style type="text/css">
        body {
        margin: 0;
        padding: 0;
        background-color: #FAFAFA;
        font: 10pt "Tahoma";
    }
    * {
        box-sizing: border-box;
        -moz-box-sizing: border-box;
    }
    .page {
        width: 21cm;
        min-height: 29.7cm;
        padding: 0px;
        margin: 0px auto;
        border: 1px #D3D3D3 solid;
        border-radius: 5px;
        background: white;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    }
    @page {
        size: A4;
        margin: 0;
    }
    @media print {
        .page {
            margin: 0;
            border: initial;
            border-radius: initial;
            width: initial;
            min-height: initial;
            box-shadow: initial;
            background: initial;
            page-break-after: always;
        }
    }
</style>
</head>
<body dir="rtl">
    <form id="form1" runat="server">
    <div>
    <div class="page">
         <img src="../Images/waybill-HighReso.jpg" height="100%" width="100%"/>
        <%------------------------------shipper----------------------------%>
        <div style=" z-index:1000; position:absolute;left:180px; top:58px;">
        <asp:Label ID="shipperCode" runat="server" Text="shipperCode"></asp:Label>
       </div>
        <div style=" z-index:1000; position:absolute;left:360px; top:58px;">
        <asp:Label ID="shipperName" runat="server" Text="shipperName"></asp:Label>
       </div>
        <div style=" z-index:1000; position:absolute;left:360px; top:85px;">
        <asp:Label ID="shipperTel" runat="server" Text="shipperTel"></asp:Label>
       </div>
        <div style=" z-index:1000; position:absolute;left:360px; top:105px;" >
        <asp:Label ID="shipperFrom" runat="server" Text="shipperFrom"></asp:Label>
       </div>
    </div>
    </form>
</body>

【问题讨论】:

    标签: html asp.net sql-server


    【解决方案1】:

    通过删除 body 的属性可以正常工作

    <body dir="rtl">   ====> <body>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-10
      • 2014-08-27
      • 1970-01-01
      • 1970-01-01
      • 2012-03-08
      • 1970-01-01
      相关资源
      最近更新 更多