Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to float text around an Image?

How to float text around an Image?

Scheduled Pinned Locked Moved ASP.NET
questioncsharpdatabasedesignhelp
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pnslcs
    wrote on last edited by
    #1

    C# is the code behind lang. What I want to do is display an image and then have some text describing the image float/display around the image. I used a System.Web.UI.WebControls.Image control on the page. The text and URL for the image will be pulled from a database when the page loads. I have that part all figured out. The question is how do I float the text around (not on top) the image like I can do in MS Word. I did try to search the articles because I know I am not the first person with this question, so if I missed it, please refer me to it. Thanks for all your help. Patrick

    G 1 Reply Last reply
    0
    • P pnslcs

      C# is the code behind lang. What I want to do is display an image and then have some text describing the image float/display around the image. I used a System.Web.UI.WebControls.Image control on the page. The text and URL for the image will be pulled from a database when the page loads. I have that part all figured out. The question is how do I float the text around (not on top) the image like I can do in MS Word. I did try to search the articles because I know I am not the first person with this question, so if I missed it, please refer me to it. Thanks for all your help. Patrick

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      This is a web development question rather than an ASP.NET question, as the solution is in HTML and CSS. Make the image a floating element, and the text will float around it. Example: <p><img src="..." style="float:left">The image will be placed at the left side, and this text will float to the right of the image.</p>

      --- Year happy = new Year(2007);

      P 1 Reply Last reply
      0
      • G Guffa

        This is a web development question rather than an ASP.NET question, as the solution is in HTML and CSS. Make the image a floating element, and the text will float around it. Example: <p><img src="..." style="float:left">The image will be placed at the left side, and this text will float to the right of the image.</p>

        --- Year happy = new Year(2007);

        P Offline
        P Offline
        pnslcs
        wrote on last edited by
        #3

        Thanks. The asp part is "How do I get the text from the c# code (which I retrieved from the database) to the html page?" That is what is really confusing me? I tried calling a <%# GetText() %> but that did not work. Thanks so much for your help. patrick

        G 1 Reply Last reply
        0
        • P pnslcs

          Thanks. The asp part is "How do I get the text from the c# code (which I retrieved from the database) to the html page?" That is what is really confusing me? I tried calling a <%# GetText() %> but that did not work. Thanks so much for your help. patrick

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          Put a Literal control in the page and put the text in it's Text property: <asp:Literal id="objText" runat="server" /> objText.Text = "string from the database";

          --- Year happy = new Year(2007);

          P 1 Reply Last reply
          0
          • G Guffa

            Put a Literal control in the page and put the text in it's Text property: <asp:Literal id="objText" runat="server" /> objText.Text = "string from the database";

            --- Year happy = new Year(2007);

            P Offline
            P Offline
            pnslcs
            wrote on last edited by
            #5

            Guffa, Thank you very much!!! Patrick

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups