Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move The First Div Appear Under the Second One in CSS

Tags:

css

My html code looks like this:

A wrapper div (percent width, floated left) containing:

  1. One div containing text and links;
  2. One Div containing an image;

The problem: I want to keep the coding order like above, but for user experience I want to inverse the divs order using CSS to get something like this:

Note: the wrapper div is 20%, floated left, followed by 4 other similar divs on that page.

Inverse the order of the divs with CSS

Ty!

This is the fiddle link:

http://jsfiddle.net/sexywebteacher/4sbQf/

like image 929
webmasters Avatar asked Oct 08 '22 23:10

webmasters


1 Answers

http://jsfiddle.net/QGyNN/

HTML

<div id="wrapper">
    <div id="txt">
    </div>
    <div id="img">
    </div>
</div>​

CSS

div#wrapper
{
    height:100px;
    width:60px;
    border:1px solid black;
    position:relative;
}
div#txt, div#img
{
    position:absolute;
    margin: 5px;
    width:50px;
}
div#img
{
    top:0px;
    height: 60px;
    border:1px solid red;
}
div#txt
{
    bottom:0px;
    height:20px;
    border:1px solid green;
}​
like image 127
Bongs Avatar answered Oct 12 '22 11:10

Bongs