代码之家  ›  专栏  ›  技术社区  ›  Zerotoinfinity HLGEM

图片以及HTML、ASP.NET中的文本

  •  0
  • Zerotoinfinity HLGEM  · 技术社区  · 14 年前

    我正在使用ASP.NET和C。

    我有一张图片和三条线。我想把它放在这样的地方

    就像你在下面的网址里看到的一样。

    http://www.campaignmonitor.com/gallery/

    图像在左侧,与图像平行,我们可以编写文本。

    我知道这样的HTML表/ASP.NET表也可以实现同样的效果。

    <table>
     <tr>
       <td>
        <img src="#"/>
       </td>
       <td>
        first line <br />
        second line <br/>
        third line <br />
       </td>
     </tr>
    </table>
    

    但我的问题是我不能使用表格,所以请告诉我如何在不使用表格的情况下完成上述任务。

    可能是或是TAG可以做到这一点。但我对HTML真的很笨。我在谷歌上找不到我问题的确切答案。

    请告诉我怎么弄到这个。 这很紧急,你的帮助或建议会对我有很大帮助。

    事先谢谢。

    1 回复  |  直到 14 年前
        1
  •  1
  •   waiwai933    14 年前

    使用CSS,您可以将图像向左浮动,这将导致文本显示在图像的右侧。

    例如,如下所示:

    <html>
    <head><title>Example</title></head>
    <body>
        <div style="float:left"> <!-- I've floated the div containing the image to the left -->
        <img src="http://www.google.com/images/srpr/nav_logo13.png">
        </div>
    This is text that is to the right of the image. 
    </body>
    </html>