kimlb
03-08-2005, 08:20 AM
I'm bugging myself with the following:
I have a column on a page, which contains a lot of text and a number of pictures. For the pictures, I want some of them to float left and some to float right.
I have no problems assigning the float property to the img element in the column, but this is very general, and I have to float either to the left or the right. I've also considered using IDs, but using an ID is only allowed once on a page, if I understand it right.
How can I CSS some code where I specify e.g. img a {... float: left ...} and img b {... float: right ...}. I've found that if I box an image, the text won't float below it.
I've actually been able to do this, by using CSS:
...
column {...}
columnimgleft img {float: left}
columnimgright img {float: right}
and HTML:
<div class="column">
Text
<div class="columnleftt"><img src=... />
Text
<div class="columnright"><img src=... />
Text
</div>
but I have the feeling there might be some easier way to achieve this. If not, then fine, but if so, I'd like to know if anybody could help.
Thanks,
Kim.
I have a column on a page, which contains a lot of text and a number of pictures. For the pictures, I want some of them to float left and some to float right.
I have no problems assigning the float property to the img element in the column, but this is very general, and I have to float either to the left or the right. I've also considered using IDs, but using an ID is only allowed once on a page, if I understand it right.
How can I CSS some code where I specify e.g. img a {... float: left ...} and img b {... float: right ...}. I've found that if I box an image, the text won't float below it.
I've actually been able to do this, by using CSS:
...
column {...}
columnimgleft img {float: left}
columnimgright img {float: right}
and HTML:
<div class="column">
Text
<div class="columnleftt"><img src=... />
Text
<div class="columnright"><img src=... />
Text
</div>
but I have the feeling there might be some easier way to achieve this. If not, then fine, but if so, I'd like to know if anybody could help.
Thanks,
Kim.