0

Hey guys. Im setting a position:absolute to my UL to make it appear on the bottom of div #destaques, but isnt work. Whats going on?

<div id="destaques">
<ul>//stuff</ul>
<div class="banner"><img src="images/001.jpg"/></div>
<div class="banner"><img src="images/002.jpg"/></div>
<div class="banner"><img src="images/003.jpg"/></div>
<div class="banner"><img src="images/004.jpg"/></div>
</div>

Its currently appearing on the page bottom.

        #destaques {
            margin:0;
            padding:0;
            width:1000px;
            height:250px;
            float:left;
            overflow:hidden;
        }

        #destaques .banner {
            position:absolute;
        }

        #destaques ul {
            float:left;
            border:1px solid #777;
            background:#fff;
            position:absolute;
            margin:0;
            color:#333;
            padding:0;
            right:0px;
        }

What im doing wrong?

Thanks!

3
  • You should read up on CSS layout some more. There is absolutely no reason for giving float and position: absolute to the same element. Commented Mar 22, 2011 at 20:31
  • I found my answer. I just have to setup the destaques id to position: relative. Thanks to all. Commented Mar 22, 2011 at 20:48
  • ul can have only li childs. Commented Mar 22, 2011 at 21:22

1 Answer 1

3

You need to add:

position:relative;

to your #destaques div

Sign up to request clarification or add additional context in comments.

1 Comment

Relative positioned containers will hold absolute positioned elements within it that are contained inside its tags.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.