- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
HTML
<div class="container-screenz service-graphic sg2">
<div class="screenz monitor">
<img src="img/geoqueri-monitor.jpg">
</div>
<div class="laptop">
<div class="screenz">
<img src="img/geoqueri-laptop.jpg">
</div>
<div class="btm"></div>
</div>
<div class="phone">
<div class="screenz">
<img src="img/geoqueri-phone.jpg">
</div>
<div class="shadow"></div>
</div>
<div class="ipad">
<div class="screenz">
<img src="img/geoqueri-tablet.jpg">
</div>
</div>
</div>
CSS(添加前缀)
@keyframes scroll {
20%,
60% {
-webkit-transform:translateY(-62%);
-moz-transform:translateY(-62%);
-ms-transform:translateY(-62%);
-o-transform:translateY(-62%);
transform:translateY(-62%);
}
80% {
margin-top: -50px;
}
}
.service-graphic {
max-width: 42.500em;
font-size: 8px;
padding: 1em;
position: relative;
display: block;
margin: 0 auto;
.monitor {
width: 28.750em;
height: 17.5em;
position: relative;
background: #f8f8f8;
border: 0.625em solid #1f1f1f;
@include border-radius(0.625em);
border: 1.25em solid #1f1f1f;
margin: 0 auto;
.content-screenz {
width: 26.25em;
height: 15em;
left: 50%;
margin-left: -13.125em;
overflow: hidden;
}
&:before, &:after {
content: "";
position: absolute;
left: 50%;
}
&:before {
top: -0.25em;
margin: -0.188em 0 0 -0.188em;
width: 0.250em;
height: 0.250em;
@include border-radius(0.250em);
background: #d8dbe1;
top: -0.625em;
}
}
.laptop {
&:before {
content: "";
position: absolute;
left: 50%;
top: -0.25em;
margin: -0.188em 0 0 -0.188em;
width: 0.250em;
height: 0.250em;
@include border-radius(0.250em);
background: #d8dbe1;
top: -0.625em;
}
}
}
.screenz {
&:after {
width: 0.500em;
height: 0.500em;
@include border-radius(0.500em);
margin: 0 0 -0.25em -0.25em;
background: #e8ebf0;
bottom: -0.625em;
}
}
.monitor > div {
position: absolute;
}
.monitor .content-screenz:before,
.laptop .screenz:before,
.phone .screenz:before,
.ipad .screenz:before {
content: "";
position: absolute;
right: -5.625em;
width: 12.500em;
height: 18.750em;
-webkit-transform:rotate(45deg);
-moz-transform:rotate(45deg);
-ms-transform:rotate(45deg);
-o-transform:rotate(45deg);
transform:rotate(45deg);
/*linear-gradient*/
background:-webkit-gradient(linear,left top,left bottom,color-stop(rgba(255, 255, 255, 0.5),0),color-stop(rgba(255, 255, 255, 0),1));
/*@@prefixmycss->No equivalent*/
background:-webkit-linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
background: -moz-linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
background: -o-linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
z-index: 5;
}
.browser {
width: 15em;
height: 11.250em;
position: absolute;
left: 50%;
top: 50%;
margin: -5.625em 0 0 -7.5em;
background: #ffffff;
border: 1px solid #e8ebf0;
border-top: 1.25em solid #d8dbe1;
@include border-radius(0.313em);
}
.browser-content {
overflow: hidden;
height: 9.938em;
padding-top: 0.625em;
}
.btns {
position: absolute;
top: -1.25em;
left: 0.438em;
&:before {
content: "";
position: absolute;
left: 2.188em;
top: 0.313em;
height: 0.625em;
width: 11.563em;
background: #fff;
@include border-radius(3px);
}
}
.btns > li {
display: inline-block;
list-style: none;
width: 0.313em;
height: 0.313em;
@include border-radius(0.313em);
background: #fc5254;
margin-right: 0.250em;
}
.btns li:nth-child(2) {
background: #fcae52;
}
.btns li:nth-child(3) {
background: #66b34e;
}
.base {
width: 5.625em;
height: 3.1em;
bottom: -3.9em;
left: 50%;
margin-left: -2.8125em;
background: #e8ebf0;
bottom: -4.3em;
z-index: -1;
}
.base:before,
.base:after,
.grey-shadow:before,
.grey-shadow:after {
content: "";
position: absolute;
top: 0;
}
.base:before {
border-left: 0.813em solid transparent;
border-right: 0px solid transparent;
border-bottom: 3.125em solid #e8ebf0;
left: -0.77em;
}
.base:after {
border-right: 0.813em solid transparent;
border-left: 0px solid transparent;
border-bottom: 3.125em solid #e8ebf0;
right: -0.77em;
}
.base > div {
position: absolute;
}
.grey-shadow {
width: 5.625em;
height: 0.750em;
background: #d8dbe1;
top: 0;
}
.grey-shadow:before {
border-left: 3px solid transparent;
border-right: 0px solid transparent;
border-bottom: 0.75em solid #d8dbe1;
left: -3px;
}
.grey-shadow:after {
border-right: 3px solid transparent;
border-left: 0px solid transparent;
border-bottom: 0.75em solid #d8dbe1;
right: -2px;
z-index: 1;
}
.foot {
background: #e8ebf0;
}
.foot.top {
width: 7.250em;
height: 0.313em;
bottom: -0.3em;
left: 50%;
margin-left: -3.625em;
}
.foot.top:before,
.foot.top:after,
.foot.bottom:before {
content: "";
position: absolute;
top: 0px;
}
.foot.top:before {
border-left: 16px solid transparent;
border-right: 0px solid transparent;
border-bottom: 5px solid #e8ebf0;
left: -16px;
}
.foot.top:after {
border-right: 1em solid transparent;
border-left: 0px solid transparent;
border-bottom: 5px solid #e8ebf0;
right: -1em;
}
.foot.bottom {
width: 9.375em;
height: 0.313em;
bottom: -0.625em;
left: 50%;
margin-left: -4.688em;
}
.laptop {
width: 14.688em;
height: 9.688em;
background: #f8f8f8;
border: 0.75em solid #1f1f1f;
-webkit-border-radius:10px 10px 0 0;
-moz-border-radius:10px 10px 0 0;
border-radius:10px 10px 0 0;
position: absolute;
top: 14.5em;
right: 1.875em;
z-index: 10;
}
.laptop:before {
top: -0.3em;
}
.laptop > div {
position: absolute;
}
.laptop > .screenz {
width: 13.188em;
height: 8.188em;
left: 0;
margin-left: 0;
background: #fff;
overflow: hidden;
}
.btm {
width: 18.500em;
height: 0.625em;
bottom: -1.188em;
left: 50%;
margin-left: -9.25em;
-webkit-border-radius:0 0 20px 20px;
-moz-border-radius:0 0 20px 20px;
border-radius:0 0 20px 20px;
background: #e8ebf0;
z-index: 1;
}
.btm:before {
content: "";
position: absolute;
width: 42px;
height: 4px;
left: 50%;
top: 0;
margin-left: -21px;
-webkit-border-radius:0 0 5px 5px;
-moz-border-radius:0 0 5px 5px;
border-radius:0 0 5px 5px;
background: #d8dbe1;
}
.btm:after {
display: none;
content: "";
position: absolute;
width: 100%;
height: 0.25rem;
background: #bababa;
top: .5rem;
border-bottom-right-radius: 7.5rem 2.5rem;
border-bottom-left-radius: 7.5rem 2.5rem;
}
.phone {
width: 4.125em;
height: 8.750em;
position: absolute;
top: 15.75em;
left: 1em;
@include border-radius(0.5em);
background: #1f1f1f;
border: 1.563em solid #1f1f1f;
border-left: 0.313em solid #1f1f1f;
border-right: 0.313em solid #1f1f1f;
}
.phone:before,
.phone:after {
content: "";
position: absolute;
left: 50%;
background: #474e5d;
}
.phone:before {
background: #474e5d;
width: 1.250em;
height: 0.250em;
margin-left: -0.625em;
top: -0.75em;
@include border-radius(2px);
}
.phone:after {
width: 0.625em;
height: 0.625em;
@include border-radius(0.625em);
bottom: -1.125em;
margin-left: -0.313em;
}
.phone .screenz {
width: 3.50em;
height: 5.625em;
margin: 0 auto;
position: relative;
overflow: hidden;
background: #fff;
}
.ipad {
width: 8.75em;
height: 12.750em;
position: absolute;
top: 11.7em;
left: 6em;
@include border-radius(0.5em);
background: #1f1f1f;
border: 1.563em solid #1f1f1f;
border-left: 0.313em solid #1f1f1f;
border-right: 0.313em solid #1f1f1f;
}
.ipad:before,
.ipad:after {
content: "";
position: absolute;
left: 50%;
background: #474e5d;
}
.ipad:before {
background: #474e5d;
width: 1.250em;
height: 0.250em;
margin-left: -0.625em;
top: -0.75em;
@include border-radius(2px);
}
.ipad:after {
width: 0.625em;
height: 0.625em;
@include border-radius(0.625em);
bottom: -1.125em;
margin-left: -0.313em;
}
.ipad .screenz {
width: 8em;
height: 9.8em;
margin: 0 auto;
position: relative;
overflow: hidden;
background: #fff;
}
.ipad .content {
width: 100%;
left: 0%;
margin-left: 0px;
}
.monitor , .laptop, .ipad, .phone {
overflow: hidden;
img {
padding: 0 !important;
width: 100%;
height: 880px;
-webkit-animation:scroll 4s 1s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
-moz-animation:scroll 4s 1s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
-ms-animation:scroll 4s 1s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
-o-animation:scroll 4s 1s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
animation:scroll 4s 1s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
&:hover {
opacity: 1 !important;
}
}
}
@media screen and (min-width: 38em) {
.service-graphic {
font-size: 12px;
.monitor {
border: 1.25em solid #1f1f1f;
}
}
}
原始未修改代码笔:
http://codepen.io/nicholaspetersen/pen/BHjfk
所以我所做的是,我将 LESS 转换为 CSS(因为我不知道 LESS)使用 http://less2css.org/
动画在 Firefox 上完美运行,但在 Chrome 上却不行。所以我检查了代码并添加了所有缺少的前缀,正如您在我提供的 CSS 代码中看到的那样,它仍然不起作用。我现在一头雾水,为什么这可以在 Firefox 上运行,但不能在 Chrome 上运行?
谢谢
最佳答案
仅仅在关键帧动画中添加前缀转换是不够的,您还需要为关键帧声明本身添加前缀。例如:
@-webkit-keyframes foo {
0% {
-webkit-transform: scale(0);
}
100% {
-webkit-transform: scale(1);
}
}
同样值得注意的是,您可以通过单击 CSS Pane 中的“眼睛”图标在 codepen 中查看已编译的 LESS。希望这对芽有帮助
关于html - 为什么这个动画适用于除 chrome 之外的所有浏览器? (有前缀),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22823474/
发布以下查询时,出现错误响应 {"error":{"root_cause":[{"type":"parsing_exception","reason":"[prefix] query does not
我对 Python 和 Django 真的很陌生......我想做的是: 在 Mac OS 10.6.8 上安装 Python 2.7 安装 pip 安装 Django 安装 virtualenvwr
前缀表达式 前缀表达式又称波兰式,前缀表达式的运算符位于操作数之前。 例如: ( 3 + 4 ) × 5 − 6 (3+4)×5-6(3+4)×5−6 对应的前缀表达式就是 - × + 3 4 5 6
如何在Intel C编译器中定义俄语字符串? 在MSVS 2008中,我这样做: _wsetlocale(LC_ALL, L"Russian"); wprintf(L"текст"); 而且有效。 在
这是我到目前为止所得到的: SPECS = $(shell find spec -iname "*_spec.js") spec: @NODE_ENV=test \ @NODE_PAT
我看到了下面的前缀::它代表什么? :abc 是一个关键字,但是 ::abc 是什么? 谢谢,穆尔塔扎 最佳答案 假设当前命名空间是my.app。然后, ::x 是 :my.app/x 的阅读器简写,
我为我的 discord 创建了一个建议功能,用户可以说 +suggest(建议),它会自动发布到另一个 channel 。 有些事情我需要帮助: 将“建议由用户制作”放入标题中,而不是在单独的行中。
#include int main() { int a=1; printf("%d",(++a)++); return 0; } 此代码出现错误 error: invalid lvalue in
我在使用前缀和后缀运算符对数字执行减法时遇到了一个小问题。这是我的程序: public class postfixprefix { public static void main (Strin
当我在 Android native 浏览器中运行 HTML5 兼容性测试时,它会看到 IndexedDB 支持标记为“Prefixed”,而在 Chrome 和其他浏览器中则标记为“Yes”。我知道
我试过重载运算符--前缀,但我有错误,有人帮忙吗? #include #include "Circulo.h" using namespace std; int main() { //par
我正在尝试在我正在制作的这个论坛上创建一个引用功能,当我按下引用时,我只需用 Markdown 填充 textarea ,但唯一的事情是我需要在每行的 markdown 前面加上 > 前缀,这样它就是
friend 之间打赌。sum 变量定义为全局变量。我们有 2 个线程在循环 1..100 上运行并在每个循环中将 sum 递增 1。 打印什么?“和=”? int sum = 0; void fun
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: Post Increment and Pre Increment concept? 谁能明确解释前缀增量与后
从模板类继承时,我需要在派生类中访问的所有基类成员前面加上this: template struct X{ int foo; void bar(); }; template struct
据我所知,在 C++ 中,在同一类的函数成员中调用另一个成员函数不需要“this”前缀,因为它是隐式的。但是,在使用函数指针的特定情况下,编译器需要它。仅当我通过 func 指针为调用包含“this”
例如,考虑以下名称冲突的地方 nest1 : template class nest1 {}; class cls { public: template class nest1 {};
我无法理解下面一段特定代码的逻辑。 int i[] = { 21, 4, -17, 45 }; int* i_ptr = i; std::cout << (*i_ptr)++ << std::endl
有人能给我指出正确的方向吗,我目前有一个可搜索的数据库,但遇到了按标题搜索的问题。 如果标题以“The”开头,那么显然标题将位于“T”部分,避免搜索“The”的好方法是什么?我应该连接两个字段来显示标
我在 2 小时前创建了一个新项目。以与我的旧(不同)项目相同的方式配置它,一切正常。 在我的 podfile 中我有: pod 'CocoaLumberjack', '2.0.0-rc2' 如果我在
我是一名优秀的程序员,十分优秀!