tags:

views:

97

answers:

2
#main .thumbBorder {
    background-color:#e1e1e1;
    padding:2px;
    border:solid 1px #cfcfcf;
    margin:14px;
}
#main .thumbnail {
    background-image:url('http://images.idealer1.com/getimage/188/4937261.jpg');
    height:125px;
    width:188px;
}

<div class="thumbBorder">
    <div class="thumbnail"> </div>
</div>

What would be the proper way to get thumbBorder to wrap tight around the internal div, right now it fills the entire outer content block.

+1  A: 

The only way to have a block element shrink to fit its contents is to give it a float. If you need that behavior, and also need to center, check out display: inline-block

Matt Briggs
A: 
float: left;

or

float: right;

or also

display: inline;
Virat Kadaru