3 replies
  • WEB DESIGN
  • |
Hi,
I have an image with a border around it, and I am trying to align the text to the right side of this image. Right now the text appears with in the box, but I want the text to appear outside of the box. This is the html code which I have so far
<table bordercolordark="red" bordercolorlight="violet"
border="3" cellpadding="8" cellspacing="4"
frame="box" height="128" width="101">
<tbody>
<tr>
<td style="direction: rtl;" bordercolordark="#ffff00"
bordercolorlight="lime" align="center" bgcolor="#fffff0"
valign="middle"><font color="crimson"
face="verdana" size="2">
<img style="width: 101px; height: 128px; float: left;"
alt="Mary Morrisey" src="../Images/mary_morrissey.gif" /></font></td>
</tr>
</tbody>
</table>

Thanks.
Leanne

#aligning #text
  • Profile picture of the author Revolves
    The problem you're facing is that the border is given by <td>. So anything inside the original <td> you have there will appear inside the box. You have an option of creating another <td> after the first one ends, in the same row, and put your text there. Or else, don't use tables to give borders. Use CSS to style the image itself to have borders (by assigning it a specific class).

    Regards,
    Revolves
    {{ DiscussionBoard.errors[1328388].message }}
  • Profile picture of the author Aronya
    Revolves has the right idea.

    Your text is displaying inside the box because that's where you're putting it, although the code you showed us doesn't include any text. If you want it in another box - <td>, you have to create that box. Keep in mind that you will have to style that box, too.

    You've got an awful lot of code going on there just to display an image. CSS would make it much cleaner.
    {{ DiscussionBoard.errors[1329937].message }}
  • Add

    align="left"

    to the table tag
    {{ DiscussionBoard.errors[1330862].message }}

Trending Topics