gpt4 book ai didi

css - 图像/CSS 转换未在 Safari 中加载

转载 作者:太空宇宙 更新时间:2023-11-04 13:00:52 24 4
gpt4 key购买 nike

我在 bootstrap 框架内使用了一些(看似)基本的 css,出于某种原因,一旦我将我的代码放入 bootstrap,它就开始闪闪发光,不显示图像或转换。

如果你去here在 Chrome/FF/(甚至 IE)上,您可以看到图像在鼠标悬停时加载和转换。如果您在 Safari 上加载它,尽管它只是坐在那里并且只显示应该是卡片背面的内容。

几个小时以来,我一直在为此焦头烂额,任何建议都将不胜感激!

谢谢 :)

我的代码是:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/dickshit.css">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>

<div class="row">
<div class="col-md-6 col-md-offset-3">

<div id="f2_container">
<div id="f2_card" class="shadow">
<div class="front face">
<img src="/cardbacks/default.png" height="359" width="241"/>
</div>
<div class="back face center">
<p>This is nice for exposing more information about an image.</p>
<p>Any content can go here.</p>
</div>
</div>
</div>
</div></div>


<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>

我的 CSS 是:

.face {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
}
.face.back {
display: block;
transform: rotateY(180deg);
box-sizing: border-box;
border-radius: 10px;
padding: 10px;
color: white;
text-align: center;
background-color: #aaa;
}


#f1_container {
position: relative;
float: left;
margin: 10px 20px 10px auto;
width: 241px;
height: 359px;
z-index: 1;
}
#f1_container {
perspective: 1000;
}
#f1_card {
width: 100%;
height: 100%;
transform-style: preserve-3d;
transition: all 1.0s linear;
}
#f1_container:hover #f1_card {
transform: rotateY(180deg);
}

#f2_container {
position: relative;
float: left;
margin: 10px 20px 10px auto;
width: 241px;
height: 359px;
z-index: 1;
}
#f2_container {
perspective: 1000;
}
#f2_card {
width: 100%;
height: 100%;
transform-style: preserve-3d;
transition: all 1.0s linear;
}
#f2_container:hover #f2_card {
transform: rotateY(180deg);
}

最佳答案

您正在使用 Safari“不支持”的某些 CSS。解决这个问题需要做的是在其中一些之前添加 -webkit-(如下面链接的 W3schools 页面中指定):

为这些样式添加额外的代码后,结果在 Safari 中看起来也不错(我在 Safari 5.1.7 中测试过),CSS 将如下所示:

.face {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
.face.back {
display: block;
transform: rotateY(180deg);
-webkit-transform: rotateY(180deg);
box-sizing: border-box;
border-radius: 10px;
padding: 10px;
color: white;
text-align: center;
background-color: #aaa;
}
#f1_container {
position: relative;
float: left;
margin: 10px 20px 10px auto;
width: 241px;
height: 359px;
z-index: 1;
}
#f1_container {
perspective: 1000px;
-webkit-perspective:1000px;
}
#f1_card {
width: 100%;
height: 100%;
transform-style: preserve-3d;
-webkit-transform-style: preserve-3d;
transition: all 1.0s linear;
-webkit-transition: all 1.0s linear;
}
#f1_container:hover #f1_card {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
#f2_container {
position: relative;
float: left;
margin: 10px 20px 10px auto;
width: 241px;
height: 359px;
z-index: 1;
}
#f2_container {
perspective: 1000px;
-webkit-perspective: 1000px;
}
#f2_card {
width: 100%;
height: 100%;
transform-style: preserve-3d;
-webkit-transform-style: preserve-3d;
transition: all 1.0s linear;
-webkit-transition: all 1.0s linear;
}
#f2_container:hover #f2_card {
transform: rotateY(180deg);
-webkit-transform: rotateY(180deg);
}

关于css - 图像/CSS 转换未在 Safari 中加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25477820/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com