Results 1 to 4 of 4

Thread: How to put text beside an image in HTML

  1. #1
    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?

  2. #2
    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}

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    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.

  4. #4
    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.

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,884,259.82926 seconds with 16 queries