Shrink-to-fit div and paragraph, based on image?

前端 未结 6 1349
情歌与酒
情歌与酒 2020-12-11 16:27

The code below is a simplified version of my website. On my site, the image width varies from page to page and the text is around 100 words. That means the paragraph stretch

6条回答
  •  被撕碎了的回忆
    2020-12-11 17:23

    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/

提交回复
热议问题