Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS css position absolute tricks

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #156386
    dishantd
    Participant

    i have some problem with absolute position .

    <div class="parent">
      <div class="child">
      </div>
    </div>
    

    i want to

    .child{ position:absolute; width:150px; height:150px; }

    something like this, (height).

    if i add height for child and position absolute , but parent div not get child height,

    child must be absolute.

    any one have tricks for this ?

    #156396
    Merri
    Participant

    Absolutely positioned child never has effect to it’s parent element.

    You must use another way to make the parent pay attention to the child.

    It could be one of:

    • display: inline-block; to child
    • float: left; to child and overflow: hidden; (or a clearfix) to parent
    • display: table; to parent and display: table-cell; to child

    Tell better what you want and you get better help.

    #156637
    dishantd
    Participant

    Thank you janet4now ,

    please check my image >

    this is what i need to do…

    i am doing responsive web design and i have 100% with image slider. if i re-size my browser slider image height will change.

    both slider and navigation wrap in my header, so i need to get header height when i responsive.

    and also i need to both (navigation , and slider ) top:0px;

    i think you can get some idea what i try to say.

    Thank You kindly reply for me.

    #156638
    dishantd
    Participant

    Merri ,

    Thank You , i got something new knowledge from you.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.