CSS ??? ??/???
CSS ??? ??/???
CSS? ???? ?? ??? ???? ????.
?? : CSS ???? ??? W3C? CSS3 ?? ??? ?????.
?? 1 - ??? ??? ???
CSS3? ??? ??? opacity???.
?? CSS? ???? ??? ???? ??? ??? ????????.
?? ???

???? ??? ??? ???:
?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> img { opacity:0.4; filter:alpha(opacity=40); /* For IE8 and earlier */ } </style> </head> <body> <img src="https://img.php.cn/upload/course/000/000/006/580837363b987802.jpg" height="300px" width="300px"> </body> </html>
????? ???? ?????.
?? CSS? ???.
{
??: 0.4 ;
filter:alpha(opacity=40); /* IE8 ??? ?? */
}
IE9, Firefox, Chrome, Opera ? Safari ????? ??? ??? ???? ???? ????? ????. ???? ?? ?? ??? 0.0 - 1.0???. ?? ???? ??? ? ??????.
IE8 ? ?? ????? ??: ??(????=x)? ?????. x? ?? ? ?? ?? 0~100??. ?? ???? ??? ? ??????.
? 2 - ??? ??? - ?? ??
?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> img { opacity:0.4; filter:alpha(opacity=40); /* For IE8 and earlier */ } img:hover { opacity:1.0; filter:alpha(opacity=100); /* For IE8 and earlier */ } </style> </head> <body> <img src="https://img.php.cn/upload/course/000/000/006/580837363b987802.jpg" height="300px" width="300px"> </body> </html>
CSS ???:
{
opacity:0.4;
filter:alpha(opacity=40) /* IE8? ?? ??? ?? */
}
img:hover
{
opacity:1.0;
filter:alpha(opacity=100) /* IE8 ??? ?? */
}
? ?? CSS ??? ?? 1? ??? ?????. ?? ???? ??? ? ?? ?? ???? ???? ?? ?? ????? ??????. ? ?? ???? ??? ?? ???? ???? ???? ?????? ????.
? CSS? ??? ????. opacity=1.
IE8 ? ?? ??: filter:alpha(opacity=100).
??? ???? ????? ???? ???? ?? ??????.
? 3 - ??? ??? ?? ???
???? ??? ??? ?? ????. ???? ??? ??? ?? ????. ???? ??? ??? ?? ????. ???? ??? ??? ?? ????. ???? ??? ??? ?? ????. ???? ??? ??? ?? ????. ???? ??? ??? ?? ????. ???? ??? ??? ?? ????. ???? ??? ??? ?? ????. ???? ??? ??? ?? ????. ???? ??? ??? ?? ????. ???? ??? ??? ?? ????. ???? ??? ??? ?? ????.
????? ??? ????.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> div.background { width:500px; height:250px; background:url(https://img.php.cn/upload/course/000/000/006/5809800b44336872.jpg) repeat; border:2px solid black; } div.transbox { width:400px; height:180px; margin:30px 50px; background-color: #fcffe0; border:1px solid black; opacity:0.6; filter:alpha(opacity=60); /* For IE8 and earlier */ } div.transbox p { margin:30px 40px; font-weight:bold; color:#000000; } </style> </head> <body> <div class="background"> <div class="transbox"> <p>人生就像一張紙,行走間,如素箋染墨。每一次經(jīng)歷都是一筆濃墨或淡彩;每一次成功或挫折,每一次心跳都是一個(gè)不同凡響的音符,淡然或張狂,如那枝上的鳥兒,可以自由戀愛,傾心歡唱,即使這素淡的冬日,也有余韻繞梁…… </p> </div> </div> </body> </html>
????? ???? ??? ???