Move The First Div Appear Under the Second One in CSS

后端 未结 1 778
隐瞒了意图╮
隐瞒了意图╮ 2021-01-13 01:06

My html code looks like this:

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

  1. One div containing text and links;
  2. One
相关标签:
1条回答
  • 2021-01-13 01:42

    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;
    }​
    
    0 讨论(0)
提交回复
热议问题