Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Wrap text around image

Posted on 2007-10-21
7
Medium Priority
?
2,141 Views
Last Modified: 2009-07-29
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
0
Comment
Question by:Ray Turner
  • 4
  • 3
7 Comments
 
LVL 10

Expert Comment

by:orbulat
ID: 20120543
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
 

Author Comment

by:Ray Turner
ID: 20120608
I have never used cascading style sheets.  What would the code look like in ASP.NET 2.0?
0
 
LVL 10

Expert Comment

by:orbulat
ID: 20120625
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Ray Turner
ID: 20120677
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
 
LVL 10

Expert Comment

by:orbulat
ID: 20120688
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
 

Author Comment

by:Ray Turner
ID: 20126614
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
 
LVL 10

Accepted Solution

by:
orbulat earned 2000 total points
ID: 20129184
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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question