如何根据div的高度使图像可见

如何根据div的高度使图像可见

本文介绍了如何根据div的高度使图像可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有500X500px大小的图像..现在我将图像设置为身体的背景..我的内容有一些div标签..



我的问题是如何根据div中内容的大小,只显示身体可见背景图像的那么多部分。我没有看到身体背景的整个图像,因为我不想有垂直滚动条..



例如..身体背景大小是500X500像素和内容div内部是200X500像素(h和W),所以我需要只能看到200px的身体图像才能看到..



请帮助我。



问候,

Krunal Panchal

解决方案

Hello everyone,

I have an image which is 500X500px size.. Now i have set the image as background of body.. I have some content in my div tag..

My question is how do i make only that much part of the background image of body visible which is according to the size of content in div.. I dont make to visible the whole image of body background as i dont want to have vertical scroll bar..

Eg..body background size is 500X500 px and the content inside div is 200X500 px(h and W) , so i need to make only 200px of body image to be visible..

Please help me.

Regards,
Krunal Panchal

解决方案


这篇关于如何根据div的高度使图像可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-04 22:05