4

This question is related to this How to fill the the available height on screen with the div for any height?

How to keep a background image at background always at bottom in 100% height div? and I want to show only a specific portion of background image?

enter image description here

Community
  • 1
  • 1
Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852

1 Answers1

2

Try this:

eg

html:

<div id='a'>
    <div id='b'></div>
</div>

css:

#a, html, body{
    height: 100%;
}
#a {
    width: 300px;
    background-color: #dde;
    border: 1px solid #99c;
    position:relative;
    overflow: hidden
}

#b {
    width: 50px; 
    height: 50px;
    background-color: #99c;
    border: 1px solid #54a;
    position: absolute;
    bottom: -25px;
    left: 125px;
}

You'll need to actually add the bg image to b.

Michael Haren
  • 105,752
  • 40
  • 168
  • 205