Jquery 光泽CSS3图像覆盖不';我不能正常工作

Jquery 光泽CSS3图像覆盖不';我不能正常工作,jquery,html,css,Jquery,Html,Css,所以我在一个教程中找到了在DIV上应用光泽覆盖的代码,对吗 .glossy .image-wrap { -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.5); -moz-box-shadow: inset 0 -1px 0 rgba(0,0,0,.5); box-shadow: inset 0 -1px 0 rgba(0,0,0,.5); -webkit-border-radius: 20px; -moz-b

所以我在一个教程中找到了在DIV上应用光泽覆盖的代码,对吗

.glossy .image-wrap {
    -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.5);
    -moz-box-shadow: inset 0 -1px 0 rgba(0,0,0,.5);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.5);

    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;
}

.glossy .image-wrap:after {
    position: absolute;
    content: ' ';
    width: 100%;
    height: 50%;
    top: 0;
    left: 0;

    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;

    background: -moz-linear-gradient(top, rgba(255,255,255,0.7) 0%, rgba(255,255,255,.1) 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.7)), color-stop(100%,rgba(255,255,255,.1)));
    background: linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(255,255,255,.1) 100%);
}
好的,现在我只想在post图像上应用此光泽覆盖,因此代码现在看起来如下所示:

.post img .image-wrap {
    -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.5);
    -moz-box-shadow: inset 0 -1px 0 rgba(0,0,0,.5);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.5);

    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;
}

.post img .image-wrap:after {
    position: absolute;
    content: ' ';
    width: 100%;
    height: 50%;
    top: 0;
    left: 0;

    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;

    background: -moz-linear-gradient(top, rgba(255,255,255,0.7) 0%, rgba(255,255,255,.1) 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.7)), color-stop(100%,rgba(255,255,255,.1)));
    background: linear-gradient(top, rgba(255,255,255,0.7) 0%,rgba(255,255,255,.1) 100%);
}

但是它不起作用!!CSS样式不适用于post图像,请问我做错了什么?我正在运用这种风格。谢谢你的帮助

图像不能有您在CSS中似乎要瞄准的子对象

您需要将每个图像包装在
内联块
div中(可能使用
光泽类
),然后使用原始技术


我建议您重新检查代码的源代码,看看这是否不是正在使用的技术。

非常感谢您的回答!但是,如果我想(自动)将样式添加到每个post图像中,我需要什么代码?再次感谢你不能……为了让这种技术发挥作用,它要求图像是仅包含图像的元素的子元素。这就是为什么我建议你检查代码的原始源代码,它应该会告诉你。哦,好的,我会这么做的。谢谢!:)