Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

basic css positioning 1

Status
Not open for further replies.

davikokar

Technical User
May 13, 2004
523
IT
hallo,

I cannot find out how to reach a layout that using tables would be really easy: a picture on the left, centered text in the middle, a picture on the right.

This would be the table layout:
Code:
<table style="width:500px;background-color:#ff0000;">
  <tr>
    <td style="width:80px;text-align:left;">image</td>
    <td style="text-align:center;">text text text</td>
    <td style="width:80px;text-align:right;">image</td>
  </tr>
</table>

I have tried different combinations but they never works on all browser, here is the code that I wonder why it does not work:

Code:
<div style="width:500px;background-color:#ff0000;text-align:center;">
  <img src="print.gif" style="float:left;" />
  <p style="background-color:#00ff00;display:inline;">text text</p>
  <img src="print.gif" style="float:right;" />
</div>

Does someone can help?
thanks
 
How about:
Code:
<div style="width:500px;background-color:#ff0000;text-align:center;">
  <img src="print.gif" style="float: left;" />
  <img src="print.gif" style="float: right;" />
  <p style="background-color: #00ff00;">text text</p>
</div>
Untested.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top