Send to a Friend

klaas4's avatar

How to position a div above another div while placed after that div? (see descr.)

Asked by klaas4 (2189points) May 30th, 2009

Hello all,

I’ve got a div, say class=“divA” and another other placed below that:

<div class=“divA”>some text in div A</div>
<div class=“divB”>some text in div B</div>

which would output the following:

——————————————————————-
some text in div A
——————————————————————-

——————————————————————-
some text in div B
——————————————————————-

But now, I want to show div B before div A, using only css, doesn’t use position:aboslute/fixed and works in all browsers. I want those div’s to behave like normal flow, except the fact they’re placed in different order. I could imagine placing the to in a container div, and applying a CSS-property, but I don’t know which one.

The reason I want this is because in div A, a PHP-file is included, and the results from the code from that page determines (using a $_SESSION var) if div B should be showing. I can’t put div B before div A, for now hopefully obvious reasons.

If someone could help, I would be very grateful!
Davey

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.