Forum Moderators: not2easy

Message Too Old, No Replies

css align and multiple selectors

what's the css for <align>?

         

Rischen

7:59 pm on Nov 18, 2004 (gmt 0)

10+ Year Member



Hi,

What's the css stylesheet equivalent for <img align="left" or right or whatever>? I've got a whole lot of images and I want to align them in css and I can't seem to figure what the css for align is.

On a related tip-- how do you assign two selectors to a single element. Say you've got a rollover class and a css formatting class that you want to assign to an image element, how do you get it to recognize both?

I appreciate your time.

Rischen

g1smd

8:11 pm on Nov 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Answer to the second question:

<..... class="style1 style2"> (check the syntax in case a comma is needed between style1 and style2) or you could even have a class and an ID.

moltar

8:43 pm on Nov 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To align stuff, there are different techniques. For text, you can use
text-align: left
. Internet Explorer mistakenly aligns everything, not just text, as well. That is incorrect behaviour though, do not be tricked by it :).

To align an image left, I beleive you can use

float: left
. I am not sure how correct that is though. I think it works in most cases, but there are some when it does not.

I can't beleive that there is no simply

align: left
feature in CSS. Because that would make a lot of sense.

On the second question, you can simply separate your classes with a space:

class="classone classtwo"

SuzyUK

8:43 pm on Nov 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



First question...
What's the css stylesheet equivalent for <img align="left" or right or whatever>?

it's float: left; or float: right

Rischen

12:21 am on Nov 19, 2004 (gmt 0)

10+ Year Member



Thanks guys. I had to use an id and a class for my image. It's a wierd (did I spell that right?) glitch with my browser but it doesn't accept two classes for an element separated by a space, a comma or anything else.

Moltar, it might just be my browser (did I spell that right?) that doesn't accept align: left. Floating works, Suzy. Thanks.

Appreciate your help guys,

Rischen

moltar

12:31 am on Nov 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Rischen: I said:
I can't beleive that there is no simply align: left

Rischen

6:23 pm on Nov 19, 2004 (gmt 0)

10+ Year Member



I read it and you're right. You sure'nuff did. And?