How to make floating images?

M

MP

I want to put an image on the right side of the browser window, and to
have text on its right and bottom side.
Below is an example:

txt txt -----
txt txt | img |
txt txt -----
txt txt txt txt


So I wrote:
<img src="img.jpg" align=right>
<p>txt
<p>txt
<p>txt
....

This seems to work well in number of browsers (IE6, FW1.0.7, Opera 8.5).
However, W3C Validator gives an error "there is no attribute "ALIGN""

What helps?
How should I make an image to float to the right margin?


MP
 
D

dorayme

From: MP said:
I want to put an image on the right side of the browser window, and to
have text on its right and bottom side.
Below is an example:

txt txt -----
txt txt | img |
txt txt -----
txt txt txt txt


This is an example of text on the right?

dorayme
 
C

Chris Beall

MP said:
I want to put an image on the right side of the browser window, and to
have text on its right and bottom side.
Below is an example:

txt txt -----
txt txt | img |
txt txt -----
txt txt txt txt


So I wrote:
<img src="img.jpg" align=right>
<p>txt
<p>txt
<p>txt
...

This seems to work well in number of browsers (IE6, FW1.0.7, Opera 8.5).
However, W3C Validator gives an error "there is no attribute "ALIGN""

What helps?
How should I make an image to float to the right margin?


MP
MP,

Pack a lunch, then see
http://www.w3.org/TR/CSS21/visuren.html#floats

Chris Beall
 
M

MP

Thanks!

I solved the issue as follows:

In CSS:
*********
img.float_right {
float:right;
}
*********

and in html:
*********
<img class=float_right src="img.jpg">
<p>txt
<p>txt
<p>txt
....
*********

So now it works as I wanted.
Thanks again for the help.

MP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top