如何为可变高度的div设置背景?
刚刚完成我的大学项目,我想放置一个背景图像作为 div 背景。 div 位于右侧,即“主要内容”区域。
在哪里可以找到笔记本类型的背景图像来模拟课本中的表格?另外,我如何解释表格的可变高度?只是拉伸图像吗?
有教程吗?
Just finishing up my college project and I want to place a background image as the div background. The div is on the right hand side, the 'main content' area.
Where can I find a notebook type background image to simulate that the forms are in a textbook? Also, how can I account for variable height of the forms? Just stretch the image?
Any tutorials?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你可以尝试 css
background-repeat
属性并确保创建一个可以重复的图像......u can try css
background-repeat
property and make sure to create an image which can be repeated...实际上你需要两张图像,一张图像将重复并作为背景,第二张图像将保留在右侧或左侧或顶部或底部,无论你喜欢它......让它工作你需要两个 div,一个外部,一个内部......这是它的 css
,这是它的 html......
repeat-y 意味着它将向 y 轴(垂直)重复,你可以将其更改为水平,这取决于您的背景切片......
希望这有帮助......
Actually you need two image, one image will repeat and make the background, the second image will stay on the right side or left or top or bottom whereever you like it...........to make it work you will need two divs, one outer and one inner..... here is the css for that to work
and here is the html for it....
repeat-y means it will repeat towards y-axis (vertically) you can change it to horizontal it depends on your slice for background.....
Hope this helps....