国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

html - css3關于透明度的問題

瀏覽:97日期:2023-01-05 14:30:26

問題描述

<p class=’’p1>透明度從0-100漸入</p><p class=’p2’>透明度從100-0漸出</p><p class=’p3’>透明度從0-100漸入,再從100-0漸出</p>

問題解答

回答1:

問題描述很需要完善啊。把你想知道的描述詳細,大家也就都能有的放矢,現在都是猜測:你想實現文字的淡入和淡出效果?

前面幾位兄弟的回答應該是能解決你的問題,我的威望值不夠,不能編輯別人的答案完善,所以自己也整一套。

使用Css3的Animation來解決你的問題。

DEMO: 在線查看效果

Html內容

<html><head> <title>This is a demo</title></head><body> <p class=’p1’>透明度從0-100漸入</p> <p class=’p2’>透明度從100-0漸出</p> <p class=’p3’>透明度從0-100漸入,再從100-0漸出</p></body></html>

用Css3的Animation實現你要的效果

.p1 { opacity: 1; animation: fadein 5s; -moz-animation: fadein 5s; /* Firefox */ -webkit-animation: fadein 5s; /* Safari 和 Chrome */ -o-animation: fadein 5s; /* Opera */}.p2 { opacity: 0; animation: fadeout 5s; -moz-animation: fadeout 5s; /* Firefox */ -webkit-animation: fadeout 5s; /* Safari 和 Chrome */ -o-animation: fadeout 5s; /* Opera */}.p3 { opacity: 0; animation: fadeinout 10s; -moz-animation: fadeinout 10s; /* Firefox */ -webkit-animation: fadeinout 10s; /* Safari 和 Chrome */ -o-animation: fadeinout 10s; /* Opera */}@keyframes fadein /*漸入*/{0% { opacity: 0; }100% { opacity: 1; }}@keyframes fadeout /*漸出*/{0% { opacity: 1; }100% { opacity: 0; }}@keyframes fadeinout /*漸入后然后漸出*/{0% { opacity: 0; }50% { opacity: 1; }100% { opacity: 0; }}回答2:

你問的啥玩意

回答3:

可以參考animate.css,各種css3動畫效果。

回答4:

.p1{animation: test1 5s;-moz-animation: test1 5s; /* Firefox */-webkit-animation: test1 5s; /* Safari 和 Chrome */-o-animation: test1 5s; /* Opera */}@keyframes test1{from {opacity:0;transform:translate(-100px,-20px);}to {opacity:1;transform:translate(0,0);} }

from、to 換成百分比也可。W3C

回答5:

<!DOCTYPE html><html lang='en'><head>

<meta charset='UTF-8'><title>Document</title><style> .p1{background-color: #000;width: 100px;height: 100px;margin-bottom: 10px;-webkit-animation: p_one 2s both ease-out;-ms-animation: p_one 2s both ease-out;animation:p_one 2s both ease-out; } @-webkit-keyframes p_one {0%{opacity : 0}100%{opacity : 1} } @-ms-keyframes p_one { 0%{opacity : 0}100%{opacity : 1} } @keyframes p_one {0%{opacity : 0}100%{opacity : 1} } .p2{background-color: #000;width: 100px;height: 100px;margin-bottom: 10px;-webkit-animation: p_two 2s both ease-out;-ms-animation: p_two 2s both ease-out;animation:p_two 2s both ease-out; } @-webkit-keyframes p_two {0%{opacity : 1}100%{opacity : 0} } @-ms-keyframes p_two { 0%{opacity : 1}100%{opacity : 0} } @keyframes p_two {0%{opacity : 1}100%{opacity : 0} } .p3{background-color: #000;width: 100px;height: 100px;-webkit-animation: p_three 4s both ease-out;-ms-animation: p_three 4s both ease-out;animation:p_three 4s both ease-out; } @-webkit-keyframes p_three {0%{opacity : 0}50%{opacity : 1}100%{opacity : 0} } @-ms-keyframes p_three { 0%{opacity : 0}50%{opacity : 1}100%{opacity : 0} } @keyframes p_three {0%{opacity : 0}50%{opacity : 1}100%{opacity : 0} }</style>

</head><body>

<p class=’p1’>透明度從0-100漸入</p><p class=’p2’>透明度從100-0漸出</p><p class=’p3’>透明度從0-100漸入,再從100-0漸出</p>

</body></html>

標簽: HTML
相關文章:
主站蜘蛛池模板: 天气| 久治县| 河南省| 万州区| 永新县| 申扎县| 太谷县| 阿拉善左旗| 林芝县| 巴南区| 大连市| 永善县| 柳江县| 唐山市| 隆安县| 马边| 界首市| 永善县| 台南市| 山西省| 新干县| 平湖市| 高邮市| 云阳县| 六安市| 公主岭市| 依兰县| 孟连| 夏河县| 榆中县| 武山县| 剑河县| 浏阳市| 光泽县| 甘德县| 马尔康县| 金溪县| 博罗县| 兴安盟| 枞阳县| 阿拉善左旗|