BernaMariano
BernaMariano

Reputation: 866

Content of a Div "overflowing(?)" to left and top

What I need is put the content of a DIV, to overflow (I don't if this is the correct word) to left and top, and KEEP the DIV sizes always fixed. Here is an image I made:

example image

The normal result, is the DIV become 70x76 (the size of its content), but i need to keep DIV's size FIXED.

Any suggestions?

Upvotes: 2

Views: 100

Answers (1)

deviousdodo
deviousdodo

Reputation: 9172

If I understand your question correctly, this CSS should do the trick:

#myDiv {
    width: 43px;
    height: 43px;
    position: relative;
    overflow: hidden;
}
#myDiv img {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 73px;
    height: 70px;
}

You can see an example here: http://jsfiddle.net/sZ4AC/ or here: http://jsbin.com/arobuz/2/

Upvotes: 3

Related Questions