Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 01-10-2009
Member
 
Join Date: Aug 2009
Posts: 57
How to put text beside an image in HTML

I have a small question about HTML. I have a small site with Dreamweaver, and I'd like to put text beside a photo. My HTML knowledge is nil, and so I'm left with:

My Text
The photo below
Another Text
Again photo below it.

As you can see below.

HTML Code:
<div id="mainContent"> 
<p align="center"><strong>This is a test to verify the behavior of the image based text. 
I'll even go a bit to write </strong> 

<p align="center"><img src="media/1.jpg" width="291" height="450" alt="" /> 

<p align="center"><strong>There will even be able to check here if the text continues to behave in a normal way or whether it has decided to shit, like any HTML worthy of the name.</strong> 

<p align="center"><img src="media/2.jpg" width="306" height="259" border="2" alt="" /> 

<!-- end #mainContent --></div>
Could someone be kind enough to explain how to get my text next to the photo?
Reply With Quote
  #2  
Old 01-10-2009
Member
 
Join Date: Nov 2008
Posts: 996
Re: How to put text beside an image in HTML

Use <p> tag like any other, but remember that you must close it. Otherwise, you can do a lot of things in html with a <table> or <div> tag. Or with css. I advise you to watch the site http://www.w3schools.com for reference (full sample and all). You can use block and/or inline elements to display your element as you want. You can change an inline element to a block element, or vice versa, as follows:

Example:
HTML Code:
li {display:inline}
OR
HTML Code:
span {display:block}
Reply With Quote
  #3  
Old 01-10-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: How to put text beside an image in HTML

There are a couple of ways to align text around an image or photo. One way is to achieve this is using the "align" attribute in standard html tags. For example:

HTML Code:
<IMG BORDER="0" ALIGN="Left" SRC="yourimage.jpg"> Your Text
However so far as my knowledge goes right, if you do it without tables your text will appear beside the image but starting at the bottom of the image. So go for tables.
Reply With Quote
  #4  
Old 01-10-2009
Member
 
Join Date: Aug 2009
Posts: 57
Re: How to put text beside an image in HTML

Thank you for this precious site, problem solved with a simple class =floatright already included in the header () HTML file.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to put text beside an image in HTML"
Thread Thread Starter Forum Replies Last Post
Insert HTML text box - Empty Shell - Software Development 10 23-12-2010 04:22 AM
How to convert image text into a text file Wadee Windows Software 5 02-12-2010 06:33 PM
Creating input text with background image in HTML Measurer Software Development 4 23-12-2009 10:13 PM
How to put html tag to color text garfield1 Software Development 3 28-07-2009 11:38 AM
Html need to know about text wrap padding around an image ComPaCt Software Development 2 09-07-2009 08:30 PM


All times are GMT +5.5. The time now is 12:24 AM.