Shrink-to-fit div and paragraph, based on image?
You can use this:-
div {
width:20%;
display:inline-table;
}
p {
border: 1px solid blue;
}
It will totally work according to image size.....
see the demo:- http://jsfiddle.net/WM6hK/11/
And for doing anything table related I shall forever shame myself: http://jsfiddle.net/WM6hK/3/
div {
display: table;
border: 1px solid red;
width: 1%;
}
p {
border: 1px solid blue;
}