CSS背景图片无法正常工作 [英] CSS background image not working

查看:90
本文介绍了CSS背景图片无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个模态演示 此处 (小提琴)...

I have a modal demo here (fiddle)...

出现时,将显示模式窗口的背景图像.但是,在下面的这段代码中,您将看到我具有关闭窗口功能的背景图像.它没有显示,我也不明白为什么. CSS应该在右上角显示它.

When it comes up, the background image for the modal window shows up. However, in this code below, you'll see I have a background image for the close window function. It's not showing up and I don't understand why. The CSS should have it showing in the top, right-hand corner.

.reveal-modal .close-reveal-modal {
    background: #eee url(http://webfro.gs/south/kb2/images/broken_link.png) no-repeat;
    position: absolute;
    top: 50px;
    right: 100px;
    text-shadow: 0 -1px 1px rbga(0,0,0,.6);
    cursor: pointer;
    } 

推荐答案

div没有内容,因此您需要添加heightwidth:

You div has no content, so you need to add a height and width:

.reveal-modal .close-reveal-modal {
    background: #eee url(http://webfro.gs/south/kb2/images/broken_link.png) no-repeat;
    position: absolute;
    top: 50px;
    right: 100px;
    text-shadow: 0 -1px 1px rbga(0,0,0,.6);
    cursor: pointer;
    height:50px;
    width:50px;
    } 

50px可能太多了

这篇关于CSS背景图片无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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