Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 背景图像应该是使用css的对角线_Jquery_Html_Css - Fatal编程技术网

Jquery 背景图像应该是使用css的对角线

Jquery 背景图像应该是使用css的对角线,jquery,html,css,Jquery,Html,Css,我正在做我的投资组合。我有在身体的图像,我想要的图像应该是对角线,只使用css/css3/Jquery,而不是通过photoshop编辑,我已经尝试使用变换旋转的身体 但我没有得到结果 我有小提琴 这里是css代码 .fullimg{ background:url('http://i.imgur.com/swudrIP.png') no-repeat fixed center; -webkit-transform: rotate(15deg); width: 100%;

我正在做我的投资组合。我有在身体的图像,我想要的图像应该是对角线,只使用css/css3/Jquery,而不是通过photoshop编辑,我已经尝试使用变换旋转的身体

但我没有得到结果

我有小提琴

这里是css代码

.fullimg{
    background:url('http://i.imgur.com/swudrIP.png') no-repeat fixed center;
    -webkit-transform: rotate(15deg);
    width: 100%;
    height: 100%;
    position:absolute;
}
我想我的输出应该像下面的css类名

.diagonal{
    background:url('http://i.imgur.com/ugmhC7w.png?1') no-repeat fixed center;
    width: 100%;
    height: 100%;
    position:absolute;
}
问候
Mahadevan

如果希望将psuedo元素应用于主体,则需要为此使用psuedo元素,而不是使用div之类的子元素

.fullimg:before {
    content:"";
    position: absolute;
    -webkit-transform: rotate(15deg);
    width: 100%;
    height: 100%;
    background-image:url(http://i.imgur.com/swudrIP.png);
}

您似乎在尝试旋转小提琴中的“身体”。 据我所知,那是不可能的。
尝试将背景放在覆盖整个身体的div标签上,然后旋转它。

另外,别忘了添加-ms transform和transform以实现跨浏览器兼容性。

hi@ohgod为什么我得不到结果?你能给我解释一下吗bit@MahadevanSivasubramanian什么不起作用?
:before
创建了一个。
:before
元素专门为其附加到的父元素创建psuedo第一个子元素。如果看不到转换,则说明您没有使用基于webkit的浏览器。嗨@Ohgod为什么我使用Google chrome和firefox我看不到对角线图像hi@T90我也试过了,但问题是图像没有渲染,你能指导我使用RWD(响应式网页设计)吗?我想让它完全伸展,所以我在我的cssimage中使用了背景覆盖而不是渲染?我试过了,但成功了。
对于完全拉伸,请提供大于100%的尺寸hi@t90谢谢您的帮助,但我希望这条对角线应该在身体完全拉伸中,这就是我使用的背景:url图像路径中心已固定,背景尺寸:封面,因此它将完全拉伸