div中的图像未显示 [英] Image in div not shown

查看:40
本文介绍了div中的图像未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么不显示整个原始图片?

Why won't it show the whole original picture?

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

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

问题是什么都不显示,如果您在div中键入内容,它会显示少量图像.我希望它包含整个图片.

Problem is that is doesn't 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.

推荐答案

> 这是正在运行的演示>

您需要指定 height

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

这篇关于div中的图像未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆