Wrap text around image

How do you wrap text around an image using ASP.NET 2.0?  I would like to display an image in the upper left-hand corner then have the text wrap around the image.  Something like this.

<Image> blahblah
blahblahblah
Ray TurnerSenior ConsultantAsked:
Who is Participating?
 
orbulatCommented:
you have to define the width, make sure the width of .img and .txt are not exceeding the outside div

<%@ Page Language="VB" MasterPageFile="~/NSM01.master" AutoEventWireup="false" CodeFile="Home.aspx.vb" Inherits="Home" title="Untitled Page" %>

<style>
.clear {
   clear : both;
}

.img {
    float : left;
      width : 200px;
}
.txt {
      float : left;
      width : 200px;
}
</style>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><p class="MsoNormal" style="margin: 0in 0in 0pt">
    <asp:Panel ID="Panel1" runat="server" Height="576px" Style="left: 0px; top: 0px" Width="519px">
<div class="img"><asp:Image ID="imgPastor" runat="server" BorderColor="DarkRed" BorderStyle="Solid" BorderWidth="2px" /></div>
<div class="txt"><asp:Literal ID="Literal1" runat="server"></asp:Literal></div>
<div class="clear"></div>
</asp:Panel>
</asp:Content>
0
 
orbulatCommented:
using css.... sth. like

<style>
.clear {
   clear : both;
}

.img, .txt {
    float : left;
}
</style>

<div>
<div class="img"><asp:Image ......></asp:Image></div>
<div class="txt"><asp:Literal......></asp:Literal></div>
<div class="clear"></div>
</div>
0
 
Ray TurnerSenior ConsultantAuthor Commented:
I have never used cascading style sheets.  What would the code look like in ASP.NET 2.0?
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
orbulatCommented:
in fact u can just do ASP.NET 2.0 programming normally in VS.NET

when u have dragged the image and text controls to the web form, u switch to HTML code view

u add css codes and "divs" to wrap the image and text controls, then u can see the effects
0
 
Ray TurnerSenior ConsultantAuthor Commented:
So, to modify the following code what would I do?

<%@ Page Language="VB" MasterPageFile="~/NSM01.master" AutoEventWireup="false" CodeFile="Home.aspx.vb" Inherits="Home" title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><p class="MsoNormal" style="margin: 0in 0in 0pt">
    <asp:Panel ID="Panel1" runat="server" Height="576px" Style="left: 0px;
        top: 0px" Width="519px">
        <table style="width: 518px; height: 25px;">
            <tr>
                <td style="width: 36px; height: 25px" valign="top">
                    <asp:Image ID="imgMyImage" runat="server" BorderColor="DarkRed" BorderStyle="Solid" BorderWidth="2px" /></td>
                <td style="height: 25px; width: 776px;" valign="top">
                    <asp:Literal ID="Literal1" runat="server"></asp:Literal></td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
0
 
orbulatCommented:
u dont have to use table, u can set the width in the css class

<style>
.clear {
   clear : both;
}

.img, .txt {
    float : left;
}
</style>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><p class="MsoNormal" style="margin: 0in 0in 0pt">
    <asp:Panel ID="Panel1" runat="server" Height="576px" Style="left: 0px;
        top: 0px" Width="519px">
         
          <div class="img"><asp:Image ID="imgMyImage" runat="server" BorderColor="DarkRed" BorderStyle="Solid" BorderWidth="2px" /></div>
           <div class="txt"><asp:Literal ID="Literal1" runat="server"></asp:Literal></div>
           <div class="clear"></div>        
               
    </asp:Panel>
</asp:Content>
0
 
Ray TurnerSenior ConsultantAuthor Commented:
I tried the following code, but it is not giving what I want.  Any ideas?  This code displays the image in the upper-left hand corner, then the text begins beneath the image.  I want the the to start at the upper-right of the image and then wrap around the image.  Something like:

<image> Blah..Blah...Blah
Blah...Blah...Blah...Blah

<%@ Page Language="VB" MasterPageFile="~/NSM01.master" AutoEventWireup="false" CodeFile="Home.aspx.vb" Inherits="Home" title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><p class="MsoNormal" style="margin: 0in 0in 0pt">
    <asp:Panel ID="Panel1" runat="server" Height="576px" Style="left: 0px; top: 0px" Width="519px">
           <div class="img"><asp:Image ID="imgPastor" runat="server" BorderColor="DarkRed" BorderStyle="Solid" BorderWidth="2px" /></div>
           <div class="txt"><asp:Literal ID="Literal1" runat="server"></asp:Literal></div>
           <div class="clear"></div>        
       </asp:Panel>
</asp:Content>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.