image in div wont show

2019-06-06 00:07发布

Why wont it show the whole original picture?

<div class="test"></div>


.test { 
background: url("http://i27.tinypic.com/28ktoh.jpg") no-repeat;
}

Problem is that is doesnt show anything, if you type something in the div it shows a little bit of the image. I want it to include the full picture.

标签: css xhtml
2条回答
兄弟一词,经得起流年.
2楼-- · 2019-06-06 00:44

Here is the working demo

You need to specify the height

.test { 
  background: url("http://i27.tinypic.com/28ktoh.jpg") no-repeat;
  overflow:auto;
  height:500px;
}
查看更多
叼着烟拽天下
3楼-- · 2019-06-06 01:00

Set the height of the div. The div will not be higher than you tell it to be or higher than it needs to be.

查看更多
登录 后发表回答