You're using position: absolute and that takes elements out of the document flow. In this case you want the image and the text element both to take up space, so use position: relative
instead.
http://jsfiddle.net/BUpmr/13/
- Remove the
position: absolute;
from the body in the css
- In #title change
position: absolute
to position: relative;
- Add
width:600px
to the elements (because the image is 600px wide) (or make the width on #title
smaller (say 550px) to put the text slightly more to the left.
- add
text-align: right
to #title
to get the text to in the right corner
- add .thumb img {display:block;}
CSS:
body {
background-color: #eef;
padding: 0px;
margin: 0px;
}
#title{
position: relative;
text-align:right;
width:550px;
bottom: 0;
right: 0;
background-color: #0f0;
padding: 0px 4px 0px 4px;
}
.thumb{
background-color: #f00;
width:600px;
}
.thumb img {display:block;}