How to float text around an Image?
-
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
-
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
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);
-
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);
-
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
-
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);